.dbf files (dBASE tables)

A .dbf is a simple database table from the dBASE family. It is still everywhere, mostly in GIS and old business software.

What is a .dbf file?

dBASE made the .dbf format popular in the 1980s: a header listing the fields, then fixed-width records one after another. FoxPro, Visual FoxPro, Clipper and many other tools adopted it, so the same ending covers several dialects. Long text fields (memos) are kept in a separate file with the same name, .dbt for dBASE or .fpt for FoxPro, and indexes in .mdx, .cdx or .ntx files.

Today most people meet .dbf in two places. One is GIS: every shapefile stores its attribute table as a .dbf next to the .shp, often with a .cpg file naming the character set. The other is business software built in FoxPro or Clipper, still exporting accounts, payroll or stock lists in it.

The weak spot is text encoding. Older files store letters in a DOS or Windows code page and don't always say which, so accents and non-Latin letters easily turn into junk when opened with the wrong one.

Converters for .dbf files

How to open a .dbf file

LibreOffice Calc opens .dbf files directly and asks for the character set, which is handy for fixing encoding problems. In GIS, QGIS (free) shows a shapefile's attribute table with all its fields. The original dBASE or FoxPro program opens them as well, if it's still around.

To get a spreadsheet or a clean UTF-8 file, use DBF to Excel or DBF to CSV. They read dBASE, FoxPro, Visual FoxPro and Clipper tables, include memo text when you add the .fpt or .dbt file, take zipped shapefiles, and let you choose the code page if the automatic one gets the letters wrong. Everything happens in the browser; the files aren't uploaded.

Questions about this format

Do I need the .cdx or .mdx file to read the data?

No. Index files only help the original program find records faster. All the data is in the .dbf, plus long texts in the .fpt or .dbt.

Can I edit a .dbf and save it back?

The converters here only read .dbf. To edit one and keep the format, LibreOffice Calc can save back to dBASE, or use the original program. For shapefiles, edit attributes in QGIS so the .dbf and the shapes stay in step.

Last updated: