What is the DVI file format?
A .dvi file is the binary typeset document produced by the TeX and LaTeX typesetting systems. The name stands for Device Independent, reflecting the design goal: the format precisely encodes every glyph position and rule on every page without committing to any specific output device - printer, screen, or typesetter.
DVI files are sequential opcode streams. The first byte is always 0xF7 (the pre preamble opcode) and the second byte is the format version: 0x02 for standard DVI or 0x03 for the Omega/Lambda extended variant with bidirectional text support. Page blocks bounded by bop and eop opcodes record absolute glyph positions, font selections, and box rules. A postamble follows containing the font table and page dimensions, and trailing 0xDF bytes pad the file to a four-byte boundary.
A critical characteristic: DVI files reference fonts by name and TFM checksum but do not embed them. The viewer or converter must have the referenced fonts available locally - typically through a TeX distribution. This differs from PDF, which embeds font subsets for self-contained rendering.
Modern TeX engines increasingly bypass .dvi entirely: pdfLaTeX and LuaLaTeX produce PDF directly; XeTeX emits an intermediate .xdv extended DVI file. The classic chain - .tex → .dvi → dvips → .ps → PDF - remains fully functional under TeX Live and MiKTeX. Plain TeX and standard LaTeX (non-PDF engines) continue to emit .dvi as their native output.
Security & safety
RISK: LOWDVI files contain no embedded scripts or macros. The 'xxx' (special) commands embed driver-specific strings (e.g. PostScript specials via dvips) but these are interpreted only by the DVI driver, not executed as code. Low risk format used exclusively in academic and TeX contexts.
Format details
in a nutshell- Digital Video Interface (hardware connector) - DVI also refers to the display connector standard (DVI-D, DVI-I, DVI-A) - entirely unrelated; hardware, not a file format.
Programs that open DVI files
Technical details
deep spec| Encoding | Binary opcode stream; multi-byte integers are big-endian |
| Magic bytes | 0xF7 at offset 0 (pre preamble opcode); 0x02 at offset 1 for standard DVI format version |
| Format variants | Version byte 0x02 = standard DVI; 0x03 = Omega/Lambda extended DVI (RTL/LTR bidirectional); XDV = XeTeX extension |
| File structure | Preamble → page blocks (bop/eop opcodes) → postamble (font table, page count, dimensions) → 0xDF padding bytes |
| Font handling | Fonts referenced by name and TFM checksum; not embedded - viewer requires local font installation |
| Font checksum | TFM checksum embedded per font definition record; mismatch triggers a viewer warning |
| File termination | Trailing 0xDF bytes pad total file length to a multiple of 4 bytes |
| Typical file size | 10 KB - 5 MB (academic paper to full book) |
| Coordinate system | Dimensions in DVI units (1 DVI unit = 100 nm at default 1000-unit magnification); absolute page positioning |
| Associated OS | Linux, Windows, macOS, Unix (cross-platform via TeX Live, MiKTeX, MacTeX) |
| Post-processing chain | dvips converts to PostScript; dvipdfm/dvipdfmx converts to PDF; dvisvgm converts to SVG |
| Byte order | Big-endian for all multi-byte integers within DVI opcodes |
| Released | 1979 (with TeX; first described in TUGboat 1982) |
| Latest version | DVI format 2 (standard); format 3 = DVItype with mixed RTL/LTR (Omega/Lambda); XDV = extended DVI used by XeTeX |
| Open standard | Yes · royalty-free |
| Specification | www.mn.uio.no |
DVI conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about DVI files.