CSV to DBF

Turn a CSV file into a dBase III table, right here on your device.

Conversion desk

On this device

Start with a file

Drop your file here or choose one from your device.

CSV · TSV · 5 files at a time, free

Its new format

FromCSV

ToDBF

Converted on this device. Nothing is uploaded.

Your file's short trip

CSV to DBF

Your file is next.

  1. Read the CSV
  2. Write records
  3. Ready

Who still needs a DBF

More programs ask for a .dbf than you might expect. GIS software keeps a shapefile's attributes in one, next to the .shp and .shx files. Business programs written in dBase, Clipper or FoxPro keep their data in DBF tables, so a new price list or customer file has to arrive in that form. If your data lives in a spreadsheet or comes out of a database as CSV, this is the way in.

We write dBase III, the plainest form of the format: version byte 0x03, with text, number, date and logical fields only. Later versions of dBase and FoxPro grew out of this layout, so their programs read it too.

One caution for shapefiles: records are matched to shapes by position, not by an ID. If you rebuild an attribute table from a CSV, keep the same rows in the same order, and give the new .dbf the shapefile's name.

How to make a DBF from a CSV

  1. Choose the Text encoding the DBF should use. Western (Windows-1252) is the default; the section on encodings below helps you pick another.
  2. Drop your .csv or .tsv file, or press Choose file. The delimiter, whether comma, semicolon or tab, is worked out from the first line, so there's nothing to set.
  3. Open What changed on the finished row. It lists renamed columns, cut texts and any characters the encoding couldn't hold.
  4. Download the .dbf. It keeps the CSV's name, with the new extension.

What's preserved, what changes

Written as dBase III (version byte 0x03). Measured by converting our 29 readable test files to CSV, comma- and semicolon-separated, and back.
WhatResult
ValuesPreserved 29 of 29 test files come back from a DBF to CSV to DBF round trip with every value intact or its change reported.
Semicolon-separated filesPreserved The decimal mark is worked out from the numbers: 29 of 29 test files come back from a round trip through a semicolon-separated CSV with the same field types and every value intact or its change reported.
Numbers, dates, true/false and textPreserved Detected per column and written as C, D, L and N fields.
Text encodingPreserved Choose from DOS 437, DOS 850, DOS 866, Windows-1250, Windows-1251, Windows-1252, Windows-1254 and UTF-8. Every choice except UTF-8 is recorded in the file's language driver byte.
Text longer than 254 bytesApproximated Cut to fit a 254-byte dBase text field, with a count in the notes (98 values in our round trips).
Column namesApproximated Turned into dBase field names: capitals, up to 10 characters of A–Z, 0–9 and _, listed in a field map.
Characters the encoding lacksApproximated Become "?" and are counted in the notes. UTF-8 keeps every character.
Numbers like 1.250 in a semicolon-separated fileApproximated When no number in the file shows which decimal mark it uses, the point is read as a thousands separator, so 1.250 becomes 1250, and the notes count them.
Memo fieldsNot converted Not written: long text goes into a text field of up to 254 bytes.
More than 255 columnsNot converted Not converted: the DBF we write holds at most 255 fields.

Preserved: arrives as it is. Approximated: arrives in a simpler form, as the row describes. Not converted: stays behind.

The round trips in the first two rows are strict. Every value has to come back as the same text, or as the same number with at most a different count of trailing zeros, so 3.00 may come back as 3 but 01234 may not become 1234. The only other change allowed is one the notes report, such as a cut. A cut is also the change you're most likely to meet in your own files; the other rows are about names, characters and decimal marks, which the next sections explain.

How columns become fields

The first row of the CSV names the fields. dBase names are short and plain, so each one is adjusted:

Every name that changed beyond its capital letters appears in the field map in the notes, so you can match new names to old ones.

Then each column gets a type from its values:

Empty cells don't count towards a column's type and are written as blanks; an empty true/false cell is stored as "?", dBase's mark for "not set". A text field is as wide as the longest value in its column, up to 254 bytes.

A semicolon-separated file can use either decimal mark, so we look at all of its numbers first. If any has a decimal comma, the kind Excel saves where the decimal separator is a comma, the numbers are read that way: 1.250,00 becomes 1250.00. If they use a decimal point instead, as DBF to CSV writes them, 12.5 stays 12.5. When nothing in the file settles it, because every number with a point looks like 1.250, the point counts as a thousands separator: 1.250 becomes 1250, and the notes say how many numbers were read that way. If those are decimals, make the file comma-separated before converting.

Choosing the text encoding

A DBF stores its text in one code page, and the program that opens it has to expect the same one, so pick the one that program uses. Except for UTF-8, your choice is written into the file's language driver byte, where readers that check it will find it.

A character the chosen code page doesn't have becomes "?", and the notes count them. The 254-byte limit counts bytes, not letters: in UTF-8 an accented letter takes two bytes, so fewer of them fit.

As for the CSV itself, Unicode files are recognised: UTF-8, with or without a byte order mark, and little-endian UTF-16 with one. Any other file is read with the code page you chose (Western, if you chose UTF-8), and the notes say so. A CSV that an older Excel saved on a Turkish Windows, for example, reads correctly once you choose Turkish (Windows-1254).

If something goes wrong

Try it with a sample file

Download sample-price-list-tr.csv (146 bytes), a three-row price list laid out the way Excel's CSV UTF-8 option writes it on a Turkish Windows: semicolons, decimal commas, day-first dates and Turkish letters. Drop it above with Western (Windows-1252), and the notes count the letters that became "?" and list the renamed column. Convert it again with Turkish (Windows-1254), and every letter stays. Either way, 1.250,00 becomes the number 1250.00 and 31.12.2024 a date field.

For a bigger table, download sample-world-countries.dbf (519 KB), turn it into CSV on the DBF to CSV page, then drop that CSV here with UTF-8 chosen. The notes will mention that it has more fields than dBase III itself reads, which later dBase versions, FoxPro and GIS tools take in their stride.

The price list is our own, free to reuse (CC0); the country table is public domain. Source and details: sample file notes.

Plans

Free and Pro

The free plan is the real product, not a trial. Pro is for people who convert in bulk, and it isn't open yet.

FeatureFreePro
Single filesFree, no watermark, no waitSame
Files at a timeUp to 5Up to 100
ZIP and folder inputPick the files insteadYes
Large filesWorks; may be slow on some devicesBuilt for them
AccountNone neededOptional
Where files goNowhere: converted on your deviceNowhere: converted on your device
Price$0Week Pass $6 · Pro $7/month or $48/year · coming soon

Privacy

Check it yourself

You don't have to take our word for it. Your browser can show you exactly what this page sends.

  1. Open your browser's developer tools (F12, or Option + Command + I on a Mac) and choose the Network tab.
  2. Convert a file on this page.
  3. Look through the requests. None of them carries your file: the page loads its code once, then the conversion runs in a Web Worker on your device.
  4. For a stronger test, turn off Wi-Fi after the page loads, then convert again. It still works.

The conversion worker runs under its own Content Security Policy, which blocks every network request:

default-src 'none'; script-src 'self'

The page itself may only talk to this site and our cookieless analytics:

connect-src 'self' https://gateway.umami.is