Home / Guides
File rescue

How to Open a DBF File on Windows 11 and Mac

By · October 7, 2026 · 9 min read

The short version

To open a DBF file on Windows 11, start with Excel: Microsoft lists dBase III and IV .dbf files as formats Excel can open but cannot save. On a Mac, Microsoft's list of Excel for Mac file formats has no dBase entry at all, so use Python with dbfread or a free online DBF to Excel converter. If the text comes out as gibberish, the file is in an old code page and has to be decoded with that one. If a column that should hold notes is empty, the memo file (.fpt or .dbt) is missing.

What a DBF file is

A .dbf is a table: one header describing the columns, then fixed-width rows. dBase, FoxBase+ and Visual FoxPro all wrote it, which is why the dbfread documentation describes DBF as "a file format used by databases such dBase, Visual FoxPro, and FoxBase+". You can read the structure straight off the bytes.

Here is the start of western.dbf, a two-row test file from our converter's test suite:

$ xxd western.dbf | head -6
00000000: 037d 0102 0200 0000 6100 1900 0000 0000  .}......a.......
00000010: 0000 0000 0000 0000 0000 0000 0003 0000  ................
00000020: 4944 0000 0000 0000 0000 004e 0000 0000  ID.........N....
00000030: 0400 0000 0000 0000 0000 0000 0000 0000  ................
00000040: 4e41 4d45 0000 0000 0000 0043 0000 0000  NAME.......C....
00000050: 1400 0000 0000 0000 0000 0000 0000 0000  ................

Microsoft's table file structure page for Visual FoxPro gives the layout, with integers stored least significant byte first:

Bytes In this file Meaning
0 03 File type
1 to 3 7d 01 02 Last update date
4 to 7 02 00 00 00 Number of records: 2
8 to 9 61 00 Position of the first data record: 97
10 to 11 19 00 Length of one record, delete flag included: 25
29 03 Code page mark
32 onward ID ... N, NAME ... C One 32-byte subrecord per field: name, then the type letter at offset 11, then the length at offset 16

So this file has an ID column of type N (numeric, 4 wide) and a NAME column of type C (character, 20 wide, 0x14). One flag byte plus 4 plus 20 is the 25 in bytes 10 to 11.

The macOS file command reads the same header and says it out loud:

$ file western.dbf russian.dbf
western.dbf: FoxBase+/dBase III DBF, 2 records * 25, update-date 125-1-2, codepage ID=0x3, at offset 97 1st record "   1Caf�                    2M�ller              "
russian.dbf: FoxBase+/dBase III DBF, 2 records * 25, update-date 125-1-2, codepage ID=0x65, at offset 97 1st record "   1�ਢ��                  2���                 "

Those question marks are the first hint of the encoding problem further down.

dBase or FoxPro: how to tell which one you have

Look at byte 0. In my files it is 03, which file and dbfread both report as FoxBase+/dBase III. Microsoft's page lists 0x30 for a Visual FoxPro table and 0x31 for Visual FoxPro with autoincrement enabled. A one-liner shows it for any file:

$ xxd -l 1 western.dbf
00000000: 03                                       .

The second clue sits next to the .dbf. Memo columns (type M) keep their text in a separate file, and per the dbfread docs on memo files that file is .fpt for Visual FoxPro and .dbt for the others. A folder with CUSTOMER.DBF, CUSTOMER.FPT and CUSTOMER.CDX came from FoxPro. Keep those files together: the .FPT format only holds blocks of text, and the .dbf holds the block numbers that point into it, so neither is useful alone.

If the FoxPro side matters to you, FoxPro memo fields and whether FoxPro is still supported go further.

How to open a DBF file in Windows 11 with Excel

Microsoft's page of file formats supported in Excel has a row for DBF 3 and DBF 4 that reads: "dBase III and IV. You can open these files formats in Excel, but you cannot save an Excel file to dBase format." The same page lists the older dBase II format as no longer supported, so Excel will not open it at all.

Open it from File, Open, and save what you get as .xlsx, because Excel will not write it back as DBF.

I have no Windows machine with Excel in front of me for this article, so I am not going to describe how Excel treats code pages or missing memo files. Check the result against the original application if you still have it, and look hard at any column with accented or Cyrillic text.

If you have Microsoft Access, it is the other Microsoft route. Its page on how to link to or import from dBASE lists dBASE III, IV, 5 and 7, reached through External Data, then More, then dBASE file.

LibreOffice Calc is the free desktop option people usually mention. I have not tested it for this article and will not make claims about it here.

How to open a DBF file on a Mac

Microsoft's list of formats for Excel for Mac covers workbooks, CSV, text, PDF, OpenDocument and more, and has no dBase or .dbf entry. So on a Mac, turn the DBF into something Excel or Numbers does read: an .xlsx or a CSV. Two ways to do that follow, one with code and one without.

Open a DBF file with Python

dbfread is a small pure-Python reader. The install page gives pip install dbfread. Its export page shows the pandas pattern, DataFrame(iter(dbf)), and pandas' to_excel writes the sheet (it needs openpyxl installed). This is what I ran, with dbfread 2.0.7, pandas 2.2.0 and openpyxl 3.1.5:

from dbfread import DBF
from pandas import DataFrame

table = DBF("western.dbf")
print(table.dbversion, table.encoding)
print(table.field_names)
frame = DataFrame(iter(table))
print(frame)
frame.to_excel("western.xlsx", index=False)
FoxBASE+/Dbase III plus, no memory cp1252
['ID', 'NAME']
   ID    NAME
0   1    Café
1   2  Müller

"no memory" is dbfread's own label for a file type without memo fields. The cp1252 came from byte 29: the DBF object reference says encoding "is determined by the language_driver byte in the header". The ID came back as an integer and NAME as a string, as the field types table says they should.

A longer walk through scripts, batches of files and CSV output is in DBF to CSV, with Python and without.

The memo file error

If a table has memo fields and the .dbt or .fpt did not come with it, dbfread stops. Our fixture memo_orphan.dbf has a NOTES memo column and no companion file:

>>> DBF("memo_orphan.dbf")
MissingMemoFile: missing memo file for memo_orphan.dbf
>>> for r in DBF("memo_orphan.dbf", ignore_missing_memofile=True): print(r)
OrderedDict({'ID': 1, 'NOTES': None})
OrderedDict({'ID': 2, 'NOTES': None})

That matches the introduction: with ignore_missing_memofile=True every memo value comes back as None. The rows survive, the notes do not. Go and find the companion file.

Why the text is garbled

Old DBF files store text as single bytes in a DOS or Windows code page, not UTF-8. The same bytes mean different letters in different code pages. russian.dbf declares 0x65 at byte 29, which dbfread maps to cp866, the Russian DOS code page in Python's standard encodings table. Reading it three ways:

>>> [r["NAME"] for r in DBF("russian.dbf")]
['Привет', 'Мир']
>>> [r["NAME"] for r in DBF("russian.dbf", encoding="cp1251")]
['ЏаЁўҐв', 'ЊЁа']
>>> [r["NAME"] for r in DBF("russian.dbf", encoding="cp437")]
['Åα¿óÑΓ', 'î¿α']

With encoding="cp1252" it did not even get that far: UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 0, because dbfread's char_decode_errors defaults to 'strict'.

The hard case is a file whose byte 29 is 00, which declares nothing, so every reader has to guess. If you see box-drawing characters or Cyrillic where there should be accents, the guess was wrong. Garbled text in old DBF files goes through the common code pages and how to pick the right one.

Open a DBF file online, free

The DBF to Excel converter on this site takes a .dbf and gives back an .xlsx. Under it is the same reader I used above, with two additions: it uses the code page the file declares, and when the file declares none it tries several and keeps the one that looks like text. Here are the three test files pushed through it, with the warnings it attaches and the cells read back out of the .xlsx:

== western
  DBF_ENCODING_DECLARED: The file declares code page cp1252; text was decoded with it.
  column ID: INT64
  column NAME: TEXT
   ('ID', 'NAME')
   (1, 'Café')
   (2, 'Müller')
== russian
  DBF_ENCODING_DECLARED: The file declares code page cp866; text was decoded with it.
  column ID: INT64
  column NAME: TEXT
   ('ID', 'NAME')
   (1, 'Привет')
   (2, 'Мир')
== memo_orphan
  DBF_ENCODING_DECLARED: The file declares code page cp1252; text was decoded with it.
  DBF_MEMO_FILE_MISSING: Memo columns (NOTES) store their text in a separate .dbt or .fpt file, which was not uploaded alongside the .dbf. Those columns will be empty. Upload both files together in a ZIP to include them.
  column ID: INT64
  column NOTES: TEXT
   ('ID', 'NOTES')
   (1, None)
   (2, None)

The memo case is the one to watch with any tool. A web form takes one file, and the .dbf is the one with the obvious name. Zip the .dbf with its .fpt or .dbt and upload the zip.

Numbers with decimals are read as exact decimals and written to Excel as numbers. Dates and codes with leading zeros, like ZIP codes in a character column, have their own traps once they reach Excel; DBF to Excel without losing dates or leading zeros covers those.

A DBF that came with a .shp file

If the .dbf sits next to a .shp file of the same name, it belongs to a shapefile. It opens like any other DBF with everything above, and the DBF inside a shapefile explains what you are looking at.

Sources