Introduction
A .dbf file is one table of the dBASE database, the best-selling database
for personal computers in the 1980s. Many other programs adopted the format, among them
Clipper and FoxPro, so there are several dialects. It is still met today because every
Esri shapefile keeps its attribute table in a
.dbf file.
Long text fields, called memo fields, are kept in a separate file beside the table:
.dbt for dBASE and .fpt for FoxPro. Indexes are also separate
files, such as .ndx, .mdx and .cdx.
Structure
A DBF file has three parts: a 32-byte header, a list of field descriptors and the records. Numbers are little-endian.
| Offset | Size | Holds |
|---|---|---|
0 | 1 | version and flags, such as 03 for dBASE III without a memo file and 83 with one |
1 | 3 | date of last update: year since 1900, month, day |
4 | 4 | number of records |
8 | 2 | length of the header, including the field descriptors |
10 | 2 | length of each record |
Each field descriptor is 32 bytes: the field name (up to 10 characters), a one-letter
type such as C for characters, N for numbers, D
for dates, L for logical and M for memo, and the field length.
The list ends with the byte 0D.
Records are fixed-length and stored as text: each begins with a deletion flag, a space
for a live record or * for a deleted one, followed by every field padded
to its length. Most writers end the file with the byte 1A. The
header, fields and records page gives
every field, version byte and field type, and the memo file layouts.
0Header version, date, record count, lengths32 bytes32Field descriptors name, type and length of each field, then0D32 bytes each…Records deletion flag and fieldsfixed length each…End of file1A1 byte
Not described
Checked against Microsoft’s Visual FoxPro table and memo pages and the Xbase notes in the November 2026 re-check. DBF was never standardised, so some parts can only come from other products’ documentation or from real files.
Known, not yet covered
- Reference: the dBASE 7 header and field descriptors (the Xbase notes point to dBase’s own file-format page, which was not read).
- Reference: index files
.ndx,.mdx,.cdxand.idx; Microsoft documents the Visual FoxPro ones (index file structure pages linked from its table page). - Reference: Visual FoxPro’s own page on data and field types, which would give the byte layouts of Currency, Double and Integer fields (the two sources read give none for Currency), and its list of supported code pages.
- Reference: the rest of the Xbase notes’ VariField description and their field-type notes for dBASE V.
Unknown
- Reference: which version-byte values each writer really uses where
Microsoft and the Xbase notes disagree (
2F/03,8A/83and so on), and whatFBmeans. - Reference: the full dBASE language driver list; the sources give only the FoxPro code page marks.
Also used for
- Esri shapefile attribute table – Esri’s vector map data: shapes in .shp, index in .shx, attributes in .dbf.
Links
Software
- LibreOffice Calc – free spreadsheet that opens and saves DBF tables, as does LibreOffice Base (Windows, macOS, Linux)
- QGIS – free GIS that edits the attribute tables of shapefiles (Windows, macOS, Linux)
- dBASE – the current version of the original database program (Windows)
Developers
Reference
- Table File Structure – Microsoft’s description of the Visual FoxPro table header and field records