What is the PAS file format?
.pas files are associated with the Pascal programming language family, including Object Pascal as used in Embarcadero Delphi and Free Pascal.
.pas files store source code for applications written in Pascal or Object Pascal - the object-oriented extension of the Pascal language. Files with the .pas extension contain instructions, type and variable declarations, and references to external libraries or units. In Delphi and Lazarus/Free Pascal projects, each .pas file typically defines a single *unit*, with a public interface section and a private implementation section.
.pas files store data in plain text format and can be edited with any text editor (Notepad, for example). It is recommended, however, that .pas files be edited using a dedicated IDE that offers syntax highlighting, error checking, code completion, line numbering, and other quality-of-life features. Popular choices include Embarcadero Delphi, Lazarus, and Visual Studio Code.
.pas files store application source code that must be compiled by a dedicated compiler to produce instructions the processor can execute. The resulting file is typically an .exe executable or a .dll if the code is a shared library. Delphi main project files use the .dpr extension; form definitions pair a .pas with a .dfm file. Free Pascal / Lazarus projects use .lpr as the main project entry point alongside .pas units.
Security & safety
RISK: LOWA .pas is human-readable text and cannot run by itself, so opening one to read is safe. The real risk is compiling and running untrusted source - review code from unknown authors before building it, as the resulting executable can do anything.
Format details
in a nutshellPrograms that open PAS files
Technical details
deep spec| File type | Plain-text program source code |
| Language | Pascal / Object Pascal (Delphi, Free Pascal, Turbo Pascal) |
| Encoding | ASCII or UTF-8; legacy files may be ANSI/Windows-1252 |
| Container | Plain text |
| Typical file size | 1 KB - 500 KB per unit |
| Magic bytes | None; unit files typically begin with the keywords unit, program, or library |
| Source structure | interface section (public declarations) and implementation section, with uses clauses, types, procedures, and functions |
| Dialect modes | Turbo Pascal, Delphi Object Pascal, or Free Pascal (selectable via {$MODE} compiler directive) |
| MIME type | text/x-pascal |
| Compilation output | .exe (executable) or .dll (shared library) |
| Companion files | .dfm (Delphi form definition), .dpr (Delphi project), .lpr (Lazarus main project), .dpk (Delphi package) |
| Associated OS | Windows, macOS, Linux, DOS (historical) |
| Released | 1970 (Pascal language); 1995 (Delphi popularized .pas as the unit file) |
| Latest version | Tracks the compiler dialect (e.g. Delphi 12 Athens / Free Pascal 3.2.x) |
| Open standard | Yes · royalty-free |
| Specification | www.freepascal.org |
PAS conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about PAS files.