What is the PRN file format?
A .prn file stores content ready for print - the raw page-description stream that an application sends to a printer driver instead of to a physical device. .prn is a generic extension used by many applications; the actual data inside depends on the printer driver selected and can be PostScript, PCL, ESC/P, raw raster, or another page-description language.
.prn files can contain:
- Formatted text
- Graphics data and images
- Graphs and tables
- Instructions for printers - page count, paper size, print style, and device-specific commands
.prn files can store data in binary or text format. Because the internal format is driver-dependent, .prn files have no fixed file signature. A PostScript .prn typically begins with %!PS, while a PCL .prn usually opens with the escape sequence ESC E (1B 45) or a PJL prologue (\x1b%-12345X@PJL). Inspecting the first bytes reveals which printer language is inside.
.prn files are generated using the Print to file command available in most applications. On Windows, the most direct way to use one is to copy it to a printer port from the command line: copy /b filename.prn LPT1 or redirect it to a network printer share. Ghostscript (with GSview) can open, render, and convert .prn files containing PostScript or PCL data. On Linux and macOS, lpr or the CUPS subsystem can spool a .prn directly to a printer queue.
If a .prn file was produced with Microsoft's XML Paper Specification driver, its extension can be changed to .xps and opened with an XPS viewer. A related Windows print spool format is .spl.
Security & safety
RISK: LOWA print-job .prn is data, not an executable, and is low-risk. Two caveats: PostScript is a full programming language, so a malicious PostScript .prn could in theory exploit an interpreter - use an up-to-date GhostScript and don't blindly send unknown files to shared/networked printers. Print jobs can also embed the full content of a sensitive document; treat captured .prn files as you would the original.
Format details
in a nutshell- Excel Space-Delimited Text (.prn) - Microsoft Excel's 'Formatted Text (Space delimited)' save format - a plain-text fixed-width table, unrelated to printing; open it in Excel or any text editor.
Programs that open PRN files
ps2pdf file.prn file.pdf, then view in Preview. Technical details
deep spec| Format type | Spooled printer data - a verbatim copy of the page-description stream written by the print spooler to disk instead of to a printer port |
| Internal encoding | Binary or plain text depending on the page-description language; PostScript and PJL are ASCII-based, PCL and raw raster are largely binary |
| Printer languages | PostScript, PCL 5/6, PJL, ESC/P, ESC/P2, or raw raster - the specific language is determined by whichever printer driver was selected when printing to file |
| File signature | No fixed magic bytes; PostScript variant begins with %!PS (hex 25 21 50 53); PCL variant typically begins with ESC E (1B 45) or a PJL prologue \x1b%-12345X@PJL |
| MIME type | application/octet-stream (no officially registered MIME type exists for .prn) |
| File structure | Flat, uncompressed byte stream starting at offset 0; no container, header table, or compression wrapper |
| Generation method | Created via the Print to file option in an application's print dialog; the OS print spooler writes the driver output directly to disk instead of sending it to a port |
| Playback on Windows | Copy the stream to the target printer port using copy /b file.prn LPT1 or copy /b file.prn \\server\printer from the command line |
| Playback on Linux / macOS | Spool directly using lpr or the CUPS subsystem; lpr -P printername file.prn sends the stream to a named printer queue |
| Viewing and conversion | Ghostscript can render, display, and convert PostScript and PCL variants on all platforms; GSview adds a GUI front-end on Windows |
| Device dependency | Typically non-portable - a .prn produced for one printer model or driver may not print correctly on a different device or driver |
| Text readability | PostScript and PJL variants are partially human-readable in a text editor; PCL and raw raster variants are binary and appear as non-printable characters |
| XPS relationship | A .prn generated with the Microsoft XPS Document Writer driver is an XPS container; renaming the extension to .xps makes it openable in any XPS viewer |
| Related formats | .ps (PostScript source file), .pcl (raw PCL stream), .spl (Windows NT/XP print spool file), .eps (Encapsulated PostScript) |
| Released | Print-to-file dates to early PC printing (1980s) |
| Open standard | Yes · royalty-free |
PRN conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about PRN files.
Frequently asked questions
How do I open a PRN file?
How do I print a PRN file?
copy /b file.prn \\PC\Printer. Linux/macOS: lpr -o raw file.prn. Viewing it on screen usually isn't possible.