.PRG

PRG File

xBase Program Source File
Ask a question
QUICK ANSWER

A PRG file is plain-text source code written in the xBase language used by dBASE, FoxPro, Clipper, and their descendants. Any text editor opens it for reading; to run or compile it you need the matching tool: Visual FoxPro (discontinued 2007), dBASE, or the open-source Harbour compiler. The file itself is safe to open in an editor, but do not run untrusted code without reading it first.

Developer: Originated with dBASE (Ashton-Tate); used by FoxPro/Visual FoxPro (Microsoft), Clipper, Harbour, xHarbour Category: Developer Files Open standard MIME: text/plain
OPENS ON Windows macOS Linux
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Aug 13, 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 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: MEDIUM

A .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
FULL NAMExBase Program Source Fileaka FoxPro program file, Clipper/dBASE program source
DEVELOPEROriginated with dBASE (Ashton-Tate); used by FoxPro/Visual FoxPro (Microsoft), Clipper, Harbour, xHarboursince early 1980s with dBASE II/III; adopted by FoxPro, Clipper and later Visual FoxPro
MIME TYPEtext/plain
TYPEPlain-text source code in the xBase (dBASE/FoxPro/Clipper) language
STANDARDOpen · royalty-free
This extension is also used by…
  • 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

Windows5 apps
dBASE Paid Open and run/compile the .prg in dBASE (dBASE PLUS) where the code is dBASE-dialect.
Notepad Open-source Open the .prg to read/edit the source as text; an xBase/Clipper syntax-highlighting UDL can be added.
Visual Studio Code Free Open the .prg; install a FoxPro/Harbour language extension for syntax highlighting.
Microsoft Visual FoxPro (legacy) Paid Open the project and run/modify the .prg, or compile it (DO program.prg / build to .app/.exe). Discontinued 2007 - legacy use only.
Harbour compiler Open-source Compile the xBase source: 'harbour program.prg' then link into a native executable (hbmk2 program.prg).
macOS2 apps
Visual Studio Code Free Open the .prg to read/edit the source; add a FoxPro/Harbour extension for highlighting.
Harbour compiler Open-source Compile xBase source natively on macOS with hbmk2.
Linux2 apps
Harbour / xHarbour Open-source Compile and link the .prg into a native Linux executable (hbmk2 program.prg); the main way to keep xBase apps alive today.
Any text editor (gedit, VS Code, Vim) Free Open the .prg as plain text to read or edit the source.

Technical details

deep spec
File typePlain-text xBase (dBASE/FoxPro/Clipper) source code
MIME typetext/plain; also seen as text/x-prg
Character encodingASCII / 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 size1 KB to a few hundred KB of source text
Compilation outputFoxPro/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
CompressionNone in source form
Encryption / distributionSource .prg is unencrypted plain text; FoxPro can encrypt compiled .app output for commercial distribution
Language dialect variantsdBASE III/IV, FoxPro 2.x, Visual FoxPro 6-9 (OOP extensions), Clipper 5.x, Harbour, xHarbour - same .prg extension with subtly differing syntax
Comment syntaxLine comments begin with * (asterisk at line start) or && (inline); NOTE keyword is also valid
Object-oriented supportVisual FoxPro introduced DEFINE CLASS / ENDDEFINE blocks inside .prg files, enabling OOP alongside procedural code
Control flow keywordsIF/ENDIF, DO WHILE/ENDDO, FOR/NEXT, DO CASE/ENDCASE, SCAN/ENDSCAN - xBase-specific syntax
OS supportOriginally DOS and Windows (dBASE, FoxPro, VFP); Harbour enables Linux and macOS compilation from the same .prg source
Current ecosystemCommercial tools discontinued (Visual FoxPro 9.0 SP2 was the last, 2007); actively maintained via open-source Harbour and xHarbour projects
Releasedearly 1980s with dBASE II/III; adopted by FoxPro, Clipper and later Visual FoxPro
Latest versionVisual FoxPro 9.0 SP2 (2007) was the last major host; the language lives on in open-source Harbour
Open standardYes · royalty-free
Specificationlearn.microsoft.com

PRG conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with PRG 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 PRG files.

Frequently asked questions

What is a .prg file?
Most commonly it's xBase program source code - text written in the dBASE/FoxPro/Clipper database language to build database applications. It's plain text and works alongside .dbf data tables.
How do I open a .prg file?
To read or edit it, open it in any text/code editor (Notepad++, VS Code). To run or compile it you need its host: Visual FoxPro (legacy), dBASE, Clipper, or the open-source Harbour compiler.
How do I run or compile a .prg file?
In Visual FoxPro, DO program.prg runs it and COMPILE/build produces .fxp/.app/.exe. With Clipper or Harbour, compile and link it into a native executable (e.g. hbmk2 program.prg). You need the matching development tool.
Can I open a .prg without FoxPro?
Yes for reading - it's plain text, so any editor shows the code. To actually execute it without FoxPro, use the open-source Harbour/xHarbour compiler (Windows/Linux/macOS), which builds the same xBase source.
Is .prg the same as an .exe?
No - .prg is the source code; an .exe is the compiled program. FoxPro turns a .prg into .fxp then .app/.exe; Clipper/Harbour compile .prg straight to a native .exe.
Why is my .prg file binary/unreadable instead of code?
Then it's probably not xBase source. .prg is also used by unrelated formats - notably GEM/Atari ST executable programs (true binaries) and a few others. A binary .prg won't open as text; identify the source program from where the file came.

References

1Microsoft Learn - Visual FoxPro documentation (archived)learn.microsoft.com
2Wikipedia - xBase (dBASE/FoxPro/Clipper language family)en.wikipedia.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.MDMarkdown Document
4.BINCD/DVD Disc Image (BIN/CUE)
5.PARTPartial Download File
6.RPMSGRestricted Permission Message
7.NOMEDIAAndroid No-Media Marker File
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.ICSiCalendar data 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