What is the PRG file format?
.prg is a source-code file associated primarily with the xBase family of database-programming languages, including dBASE, FoxPro, Visual FoxPro, Clipper, and the modern open-source Harbour compiler. A .prg file is also a generic extension used by various programs to store macros or program instructions; such files are not standardized and serve different purposes depending on the application.
In its dominant xBase role, a .prg stores plain-text source code - not binary data - making it readable in any text editor. A typical program begins with comment lines (prefixed with * or &&), SET directives, and PROCEDURE/FUNCTION blocks that operate on .dbf database tables. When compiled, FoxPro produces a binary .fxp object file, while Clipper and Harbour generate a native executable; the .prg source itself is always human-readable. The xBase language traces back to dBASE II/III in the early 1980s and dominated desktop-database programming through the 1990s. Visual FoxPro 9.0 SP2 (2007) was the last major commercial release; the language lives on through the open-source Harbour project.
.prg files are sometimes used by programmers or university lecturers for educational or testing purposes. Such files may store pseudocode - an informal, high-level description of a computer program or algorithm in plain text. Pseudocode is an abstraction, not an implementation, of a computer program; it contains standard control instructions such as loops or conditional expressions in human-readable rather than machine-readable format. Pseudocode is language-independent and cannot be executed on a computer. .prg files are sometimes chosen for pseudocode precisely because the extension does not refer to any actual programming language.
Security & safety
RISK: MEDIUMA .prg is plain-text source code, so the file itself can't execute by being opened in an editor - reading one is safe. The risk is in what it does when run/compiled: xBase code can run shell commands (RUN/!), read and write database files, and delete data, so don't blindly DO or compile an untrusted .prg. Read the source first, run legacy apps in an isolated/VM environment, and be wary of programs that touch .dbf data you care about. (The unrelated GEM/Atari .prg is a true binary executable - treat any .prg that is binary, not text, with extra caution.)
Format details
in a nutshell- GEM / Atari ST program - On Atari ST and GEM/DOS, .prg is an executable PROGRAM file (a true binary), not source code.
- Lotus 1-2-3 / Symphony program - Some Lotus and other DOS-era apps used .prg for macro/program scripts.
- MicroSim PCBoard / WAVmaker file - A few engineering and music tools reused .prg for their own data; rare and unrelated to xBase.
Programs that open PRG files
Technical details
deep spec| File type | Plain-text xBase (dBASE/FoxPro/Clipper) source code |
| MIME type | text/plain; also seen as text/x-prg |
| Character encoding | ASCII / Windows-1252 for Western locales; legacy OEM DOS codepage in older Eastern European files |
| File signature (magic bytes) | None - plain text with no binary header; programs typically open with comment lines (* or &&), SET directives, or a PROCEDURE/FUNCTION declaration |
| Typical file size | 1 KB to a few hundred KB of source text |
| Compilation output | FoxPro/VFP compiles .prg to a binary .fxp object file; Clipper and Harbour compile to a native executable |
| Companion data format | .dbf - xBase programs are tightly coupled to dBASE table files for data storage and retrieval |
| Compression | None in source form |
| Encryption / distribution | Source .prg is unencrypted plain text; FoxPro can encrypt compiled .app output for commercial distribution |
| Language dialect variants | dBASE III/IV, FoxPro 2.x, Visual FoxPro 6-9 (OOP extensions), Clipper 5.x, Harbour, xHarbour - same .prg extension with subtly differing syntax |
| Comment syntax | Line comments begin with * (asterisk at line start) or && (inline); NOTE keyword is also valid |
| Object-oriented support | Visual FoxPro introduced DEFINE CLASS / ENDDEFINE blocks inside .prg files, enabling OOP alongside procedural code |
| Control flow keywords | IF/ENDIF, DO WHILE/ENDDO, FOR/NEXT, DO CASE/ENDCASE, SCAN/ENDSCAN - xBase-specific syntax |
| OS support | Originally DOS and Windows (dBASE, FoxPro, VFP); Harbour enables Linux and macOS compilation from the same .prg source |
| Current ecosystem | Commercial tools discontinued (Visual FoxPro 9.0 SP2 was the last, 2007); actively maintained via open-source Harbour and xHarbour projects |
| Released | early 1980s with dBASE II/III; adopted by FoxPro, Clipper and later Visual FoxPro |
| Latest version | Visual FoxPro 9.0 SP2 (2007) was the last major host; the language lives on in open-source Harbour |
| Open standard | Yes · royalty-free |
| Specification | learn.microsoft.com |
PRG conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about PRG files.