.pas

What is a .pas file?

Pascal / Delphi Source File · Code and data · Niklaus Wirth; Borland/Embarcadero (Delphi) · 1970

A .pas file is Pascal source code, the teaching language of the 1970s and 80s that lives on today mainly as Delphi and Free Pascal. Plenty of Windows business software is still built from .pas files.

Category
Code and data
MIME type
Type
Plain text
Also seen as
.pp
Is a .pas file safe to open? Caution. A .pas file is program source. Compiling and running it executes its code; review unfamiliar files first.

What is a .pas file used for?

Pascal was designed by Niklaus Wirth to teach structured programming, and for years it was the standard first language. Borland's Turbo Pascal and then Delphi turned it into a serious application language for DOS and Windows.

Modern .pas files are usually Object Pascal, written for Delphi or the open-source Free Pascal compiler with the Lazarus IDE. The files are plain text.

How to open a .pas file

The .pas format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .pas file.

Windows

  • Delphi
  • Lazarus (Free Pascal)
  • any text editor

macOS

  • Lazarus (Free Pascal)
  • VS Code
  • any text editor

Linux

  • Lazarus (Free Pascal)
  • VS Code
  • any text editor

How to convert a .pas file

You can convert a .pas file to exe (compiled) using a conversion tool or the export menu of an app that opens it.

.pas file signature (magic bytes)

Programs recognise a .pas file by the bytes at the start of the file, not by its name. These are the signatures for Pascal.

Hex signatureOffsetNote
(no fixed signature)0plain text; no fixed magic bytes

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .pas file?

A .pas file is Pascal source code, the teaching language of the 1970s and 80s that lives on today mainly as Delphi and Free Pascal. Plenty of Windows business software is still built from .pas files.

How do I open a .pas file?

Any text editor shows the source. To compile it, use Free Pascal (with the Lazarus IDE) or Delphi, depending on which dialect the code targets.

Is Pascal still used?

Yes. Delphi remains common in business and industrial Windows software, and Free Pascal with Lazarus keeps the language alive cross-platform and open source.

What is the difference between .pas and .pp?

Both are Pascal source. .pp is a convention some Free Pascal code uses to mark units written for that compiler, while .pas is the universal extension.

Related formats

Sources

Details on this page were checked against authoritative references: