.PAS

PAS File

Pascal Source File
Ask a question
QUICK ANSWER

A PAS file is Pascal or Object Pascal source code. You can read it in any text editor, but it needs a compiler (Free Pascal or Delphi) to produce a running program. It is safe to open for reading; be cautious about compiling and running source from unknown authors.

Developer: Pascal language: Niklaus Wirth (1970); Delphi/Object Pascal: Borland/Embarcadero Category: Developer Files Open standard MIME: text/x-pascal
OPENS ON Windows macOS Linux
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Aug 4, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

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: LOW

A .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 nutshell
FULL NAMEPascal Source Fileaka Delphi unit source file, Pascal unit
DEVELOPERPascal language: Niklaus Wirth (1970); Delphi/Object Pascal: Borland/Embarcaderosince 1970 (Pascal language); 1995 (Delphi popularized .pas as the unit file)
MIME TYPEtext/x-pascal
TYPEPlain-text program source code (text)
STANDARDOpen · royalty-free

Programs that open PAS files

Windows4 apps
Embarcadero Delphi Paid Open the containing project, or File → Open the .pas to edit and compile it.
Notepad Open-source Open to read/edit the source with Pascal syntax highlighting (does not compile).
Lazarus (Free Pascal) Open-source Open the .pas/.lpr in Lazarus and press Run to compile with the bundled Free Pascal compiler.
Visual Studio Code Free Open the .pas; install an OmniPascal/FPC extension for highlighting and build tasks.
macOS2 apps
BBEdit Freemium Open the .pas to read/edit as text (no compilation).
Lazarus (Free Pascal) Open-source Open and compile the .pas with the bundled Free Pascal compiler.
Linux2 apps
Lazarus (Free Pascal) Open-source Open and build the project, or compile a unit with fpc on the command line.
gedit / any text editor Open-source Open the .pas to view/edit the source code.

Technical details

deep spec
File typePlain-text program source code
LanguagePascal / Object Pascal (Delphi, Free Pascal, Turbo Pascal)
EncodingASCII or UTF-8; legacy files may be ANSI/Windows-1252
ContainerPlain text
Typical file size1 KB - 500 KB per unit
Magic bytesNone; unit files typically begin with the keywords unit, program, or library
Source structureinterface section (public declarations) and implementation section, with uses clauses, types, procedures, and functions
Dialect modesTurbo Pascal, Delphi Object Pascal, or Free Pascal (selectable via {$MODE} compiler directive)
MIME typetext/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 OSWindows, macOS, Linux, DOS (historical)
Released1970 (Pascal language); 1995 (Delphi popularized .pas as the unit file)
Latest versionTracks the compiler dialect (e.g. Delphi 12 Athens / Free Pascal 3.2.x)
Open standardYes · royalty-free
Specificationwww.freepascal.org

PAS conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with PAS files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about PAS files.

Frequently asked questions

What program opens a PAS file?
Any text editor (Notepad++, VS Code, gedit, BBEdit) opens it to read or edit. To compile it, use Free Pascal/Lazarus (free) or Embarcadero Delphi.
How do I compile a PAS file into a program?
With Free Pascal run 'fpc yourfile.pas', or open the project in Lazarus/Delphi and build. Usually you compile the project's main .dpr/.lpr, which uses your .pas units.
What is the difference between a .pas and a .dpr file?
A .pas is normally a unit (a reusable module), while a .dpr is the Delphi project's main program file that ties the units together. Free Pascal/Lazarus uses .lpr for the main file.
Can I open a PAS file without Delphi?
Yes. Read it in any text editor, and compile it for free with Free Pascal or the Lazarus IDE - no Delphi license needed.
Is a PAS file safe to open?
Reading it is safe because it is just text. Be cautious about compiling and running source from untrusted sources, since the built program can do anything.
Why does my PAS file fail to compile?
Often it depends on other units (the uses clause) or a specific dialect. Open the whole project in Lazarus/Delphi, or set the matching mode (e.g. {$MODE Delphi}) in Free Pascal.

References

1Free Pascal - official site and docswww.freepascal.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.BINCD/DVD Disc Image (BIN/CUE)
7.NOMEDIAAndroid No-Media Marker File
8.RPMSGRestricted Permission Message
9.MDMarkdown Document
10.TMPTemporary File

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z