Converting DBF: what gets lost and how to avoid it
Conversion looks like a mechanical step, yet it is where data is damaged most often — silently, without a single error message.
What to check before converting
- Encoding. If accented text reads correctly in the viewer, it will be correct in the export. If it does not, fix the encoding first — otherwise you convert garbage. See garbled characters in DBF.
- Memo. Are there M fields, and is the .fpt or .dbt present? Without it the text will not reach the export.
- Deleted records. Decide in advance whether you want them. A row-count difference is hard to explain afterwards.
- Record count. A DBF header sometimes overstates the counter: the file was cut short during a copy. An honest tool warns about it.
Where to convert to
XLSX — when the file goes to a person. Numbers should stay numbers, dates stay dates, codes stay text. A correct export does this itself, and nothing has to be “fixed” by hand in Excel.
CSV — when the file goes to another program. Two settings decide: encoding and delimiter. Older systems tend to want a single-byte code page such as windows-1252 and a semicolon; modern ones want UTF-8 and a comma. More in CSV encoding.
SQL — when the data is moving into a database. An export with a ready-made CREATE TABLE saves describing a hundred and fifty fields by hand and does not get the types wrong.
JSON — when the data goes to a web service.
The reverse: producing a DBF
Sometimes you need the opposite — to hand data to an old system that accepts only DBF. Here the limits of the format come up:
- a field name is at most ten characters, with no dots or slashes;
- a text field is at most 254 bytes, and what counts is bytes: an accented letter takes one byte in a single-byte code page and two in UTF-8;
- the encoding is single-byte only — no old program reads UTF-8 in a DBF;
- long text goes to memo, which means a second file appears, and the two have to travel as a pair.
A tool must say what exactly it changed: how it shortened a field name, what it moved to memo, where it truncated a value. A silent conversion is the worst option there is.
How to check the result
The most reliable check is reading it back. Export to DBF, open the resulting file and compare it with the original on a key field. If the tool can compare tables, this takes a minute and shows the differences down to the field.
For CSV and XLSX exports, spot-checking the riskiest columns is enough: codes with leading zeros, long identifiers, dates and amounts with decimals.
FAQ
How many records fit in a CSV?
There is no limit. The 1,048,576-row ceiling is Excel's, not the format's.
Does the deletion flag survive a conversion?
In CSV and XLSX only if you output it as a column explicitly. When exporting to DBF the flag is preserved.
What about General and Picture fields?
They are binary objects and do not transfer meaningfully to text formats. The size is shown and the data stays in the DBF.
Free for personal use. Your file is not uploaded to a server. Windows version — 3.5 MB, no installation: details. Organizations: license.