The Complete Guide to Excel To Dbf: Everything You Need to Know
The dBASE DBF format has outlasted dozens of technologies that were supposed to replace it. Originally designed for dBASE II in the late 1970s, the format remains the backbone of Esri Shapefiles, legacy accounting exports, government data distribution, and FoxPro-era business systems still running in production today. Meanwhile, Excel has become the near-universal tool for organizing tabular data in business environments โ meaning the gap between where data lives (Excel) and where legacy systems need it (DBF) is a problem analysts and developers encounter constantly.
This guide covers everything you need to know about converting Excel spreadsheets to DBF format: how the conversion works, what field type decisions are made automatically, which DBF version to choose, how to handle edge cases, and how to get the cleanest possible output for GIS workflows, legacy database imports, and data migrations.
Convert Excel to DBF instantly: Drop any .xlsx or .xls file to get a standards-compliant dBASE III+ binary file โ free, private, nothing leaves your browser.
Open Excel to DBF Converter โTable of Contents
- What Is the DBF Format?
- Why Convert Excel to DBF?
- How Excel-to-DBF Conversion Works
- Field Type Mapping: Excel Columns to DBF Fields
- Choosing the Right DBF Version
- Field Name Rules and Sanitisation
- Multi-Sheet Workbooks
- Best Practices for Clean Conversions
- Common Issues and How to Fix Them
- Use Cases by Industry
- GIS and Shapefile Workflows
- Privacy and Security
What Is the DBF Format?
DBF (dBASE File) is a binary file format for storing tabular data โ rows and columns โ in a compact, fixed-width structure. The format was introduced with dBASE II in 1979 and refined through dBASE III, dBASE IV, FoxPro, Visual FoxPro, and several compatible variants over the following decades.
A DBF file has three structural sections:
- File header (32 bytes): Contains the version byte, last-updated date, total record count, header size, and record size. This block is read first by every application that opens a DBF file.
- Field descriptor array: Starting at byte 32, a sequence of 32-byte entries โ one per column โ each declaring the field name (up to 10 characters), type code (
C,N,D,L, or others), width in bytes, and decimal count. The array ends with a0x0Dterminator byte. - Data records: Each record begins with a deletion-flag byte (
0x20active,0x2Adeleted) followed by the field values packed consecutively. Fields are fixed-width โ no delimiters.
The key characteristic that distinguishes DBF from CSV or Excel is its fixed-width binary structure. Every field in every record occupies exactly the same number of bytes, declared in the field descriptor. This makes DBF highly efficient for sequential access and direct-address record retrieval, which is why legacy database engines built their performance models around it.
| Feature | DBF | CSV | Excel (.xlsx) |
|---|---|---|---|
| Format type | Binary, fixed-width | Text, variable-width | Binary XML archive |
| Field types enforced | Yes | No | Yes (cell formats) |
| Max field name length | 10 characters | Unlimited | Unlimited |
| Max fields per record | 128 (dBASE III) | Unlimited | 16,384 columns |
| Legacy system support | Excellent | Good | Limited |
| GIS attribute table format | Native (Shapefile) | No | No |
Why Convert Excel to DBF?
Most Excel-to-DBF conversions happen in one of five situations:
- GIS and mapping workflows. Esri Shapefiles require a
.dbffile for the attribute table. If you're building or updating a Shapefile from an Excel dataset โ common in municipal GIS, environmental consulting, and real estate โ you need to produce a compliant DBF. QGIS, ArcGIS, and PostGIS all read the DBF component directly. - Legacy database imports. FoxPro applications, Clipper-based systems, and dBASE IV databases still running in production often accept data updates only as DBF files. Analysts who prepare data in Excel need a reliable path from spreadsheet to DBF without a dedicated FoxPro installation.
- Government and regulatory submissions. Some regulatory bodies, municipal agencies, and state-level reporting systems specify DBF as the required submission format for tabular data. The submitter invariably prepared the data in Excel first.
- Data migration pipelines. ETL workflows that ingest DBF as a source format sometimes need to rebuild or repair a DBF from a corrected Excel version โ particularly during data cleanup projects where the original DBF had encoding or structural issues.
- Archival and distribution. Organizations distributing reference data to field offices or partner organisations that run legacy systems sometimes package the data as DBF for maximum compatibility.
How Excel-to-DBF Conversion Works
The conversion process has four stages. Understanding each stage helps you predict the output and avoid surprises.
Stage 1: Workbook parsing
The Excel file is parsed using SheetJS (xlsx.js), which handles both .xlsx (Office Open XML) and .xls (BIFF8 legacy) formats. SheetJS reads cell values, cell types, and date serial numbers. For date cells, it converts Excel's numeric serial date values to YYYY-MM-DD strings for downstream type detection. This stage produces a 2D array of rows where every value is a string or null.
Stage 2: Type inference
For each column, the converter scans all data rows (excluding the header) and infers the DBF field type:
- If every non-empty value matches
YYYY-MM-DDformat โ typeD(Date) - If every non-empty value is
true/false/yes/no/t/f/y/n(case-insensitive) โ typeL(Logical) - If every non-empty value converts cleanly to a number โ type
N(Numeric) - Otherwise โ type
C(Character)
Type inference is conservative: a column is only classified as Numeric if every non-empty value is numeric. A single non-numeric value forces the column to Character. This prevents data loss at the cost of occasionally producing a wider Character field than strictly necessary.
Stage 3: Field width calculation
Once the type is determined, the converter calculates the field width:
- Character fields: Width = length of the longest value in the column, capped at 254 (the dBASE limit for C fields).
- Numeric fields: Width = digits before the decimal + decimal point + decimal digits + 1 sign byte. Capped at 19.
- Date fields: Always 8 bytes (
YYYYMMDD). - Logical fields: Always 1 byte (
TorF).
Stage 4: Binary assembly
The converter writes the DBF binary structure directly in memory using a Uint8Array:
- 32-byte file header with version byte, today's date, record count, header size, and record size
- One 32-byte field descriptor per column
- Header terminator byte (
0x0D) - One record per data row: deletion flag byte + field values, each space-padded or right-aligned to their declared width
- EOF marker byte (
0x1A)
The resulting binary is offered as an in-memory download. Nothing is transmitted to a server at any stage.
Field Type Mapping: Excel Columns to DBF Fields
DBF supports four core field types in the dBASE III+ specification. Here is how Excel column content maps to each:
| DBF Type | Code | What triggers it | Storage format |
|---|---|---|---|
| Character | C | Default; any column not matching Numeric, Date, or Logical | Left-aligned, space-padded ASCII string up to 254 bytes |
| Numeric | N | All non-empty values parse as numbers (integers or decimals) | Right-aligned ASCII digit string with optional decimal point and sign |
| Date | D | All non-empty values match YYYY-MM-DD (Excel date cells) | 8-byte ASCII YYYYMMDD string |
| Logical | L | All non-empty values are boolean-like: true/false/yes/no/t/f/y/n | Single byte: T or F |
Why mixed-type columns become Character
A common question is why a column that is "mostly numeric" still exports as Character. The reason is data integrity: if even one cell in a column contains a non-numeric value โ a note, a placeholder like "N/A", an empty string โ and the column were exported as Numeric, those values would be silently lost (written as zeros or spaces). The conservative approach โ fall back to Character โ preserves all cell content, even at the cost of wider field width.
If you want a column to export as Numeric, ensure every non-empty cell in that column contains a valid number before converting. A single text value in an otherwise numeric column will force it to Character.
Decimal precision
For Numeric fields, the converter scans all values to find the maximum number of decimal places used in the column and sets that as the field's decimal count (up to 15 decimal places, the dBASE limit). If all values are integers, the decimal count is 0 and no decimal point byte is included in the width calculation.
Choosing the Right DBF Version
The converter supports three DBF version codes, selectable via the "DBF Version" dropdown:
| Version | Byte value | When to choose it |
|---|---|---|
| dBASE III+ (default) | 0x03 | Maximum compatibility. Use this for QGIS, ArcGIS, PostGIS, and any legacy application where you are unsure of the version expectation. |
| dBASE IV | 0x04 | Use when importing into a dBASE IV application or a system that specifically declares IV compatibility. Structurally similar to III+; the version byte is the main difference at this tool's output level. |
| dBASE 5 / Visual FoxPro | 0x05 | Use when the target system is a Visual FoxPro application. VFP can read III+ files without issue, but declaring version 5 can enable VFP-specific optimisations in some applications. |
For the vast majority of use cases โ GIS workflows, legacy imports, government submissions โ dBASE III+ is the correct choice. It is the version Esri's Shapefile specification requires, and it is what virtually all DBF-reading applications default to when the version byte is 0x03.
Rule of thumb: If you don't know which version the target system expects, choose dBASE III+. It is the safest choice and is readable by every DBF-aware application.
Field Name Rules and Sanitisation
DBF field names have strict constraints inherited from the dBASE specification:
- Maximum 10 characters
- Only alphanumeric characters and underscores allowed
- Must start with a letter (not a digit or underscore)
- Case is preserved but applications typically treat names as case-insensitive
Excel column headers rarely satisfy all of these constraints. The converter applies the following sanitisation rules automatically:
- Any character that is not alphanumeric or an underscore is replaced with
_ - If the resulting name starts with a digit or underscore, an
Fprefix is prepended - Names longer than 10 characters are truncated at the 10th character
- The result is converted to uppercase
- If two columns produce the same sanitised name, a numeric suffix is appended to de-duplicate (e.g.,
FIELD_1,FIELD_2)
The conversion result panel's "Field Map" table shows exactly what each Excel column header became as a DBF field name. Review this table before downloading โ if a sanitised name is unclear, rename the corresponding Excel column header and reconvert.
Common sanitisation examples
| Excel column header | Sanitised DBF field name | Reason |
|---|---|---|
| First Name | FIRST_NAME | Space replaced with underscore; truncated at 10 chars |
| Address Line 1 | ADDRESS_LI | Truncated to 10 characters |
| 2024 Revenue | F2024_REVE | Starts with digit; F prefix added; truncated |
| Amount ($) | AMOUNT____ | Non-alphanumeric chars replaced with underscore |
| Date | DATE | Clean โ no changes needed |
Multi-Sheet Workbooks
When you drop a multi-sheet workbook, the converter populates the "Sheet to Convert" dropdown with all sheet names. Only one sheet is converted per operation.
Each sheet is converted independently, producing one DBF file. If you need multiple sheets as separate DBF files, run the conversion once per sheet and download each result individually.
The sheet name does not appear anywhere in the output DBF file โ the output filename is based on the original Excel filename with the extension changed to .dbf.
Best Practices for Clean Conversions
Prepare your Excel file before converting
A few minutes of cleanup in Excel yields a much cleaner DBF output:
- Shorten column headers to 10 characters or fewer before converting. If your headers are "Customer First Name" or "Invoice Total Amount", abbreviate them to "CUST_FNAME" and "INV_TOTAL" before converting. This gives you control over the field names rather than relying on automated truncation.
- Remove merged cells, empty rows, and formatting rows. Merged cells confuse SheetJS parsing; empty rows at the top of a sheet push headers to row 2 or later. Ensure row 1 is a clean header row and data starts at row 2.
- Format date columns as dates in Excel. SheetJS converts Excel date serial numbers to
YYYY-MM-DDstrings when cell format is a date format. If your date column is stored as plain text (e.g., "2024-01-15"), type inference will still detect theYYYY-MM-DDpattern and classify it as typeDโ but it's safer to have Excel treat them as dates. - Ensure numeric columns have no text values. As explained in the field type mapping section, a single text value in a numeric column forces the column to Character. Search for "N/A", blank substitutes, or notes in columns you want to export as Numeric and either remove them or replace them with a numeric sentinel value.
Verify the field map
After clicking Convert, always review the "Field Map" table that appears in the result panel before downloading. Confirm that:
- Every field name looks correct and meaningful
- The inferred type matches what you expect (N for numbers, D for dates, L for boolean, C for text)
- Field widths look reasonable โ a Character field that is 254 bytes wide usually means a column had a very long cell value somewhere
Test the output before deployment
Always open the downloaded DBF in your target application before using it in production. For GIS workflows, open it in QGIS (Layer โ Add Layer โ Add Delimited Text Layer won't work; use DB Manager or the DBF file directly as a Shapefile attribute table). For legacy database imports, load it into a test environment first.
Common Issues and How to Fix Them
Column truncated to 254 characters
DBF Character fields have a maximum width of 254 bytes. If any cell in a column contains more than 254 characters, the field is capped at 254 and longer values are silently truncated at export time. To avoid data loss, ensure no cell exceeds 254 characters in columns you intend to export as Character fields. Use Excel's LEN() function to find offending cells: =MAX(LEN(A:A)) returns the longest value in column A.
Field names are not what I expected
Review the "Field Map" table in the result panel. If a sanitised name is unusable, go back to your Excel file, rename the column header to the 10-character name you want (letters and underscores only, starting with a letter), and reconvert. The converter will use your header as-is when it already satisfies all DBF naming rules.
Numbers exporting as Character
The most common cause is a non-numeric value somewhere in the column โ a hyphen used as a null placeholder, a "TBD" note, or a formula error (#VALUE!, #DIV/0!). Open Excel, filter the column for non-numeric values, resolve them, and reconvert.
More than 128 columns
The dBASE III specification limits a DBF file to 128 fields. If your Excel sheet has more than 128 columns, the converter will export the first 128 and warn you in the warnings panel. To work around this: split the data into multiple sheets, each under 128 columns, and convert each sheet separately.
The output file is rejected by a legacy application
Try switching the "DBF Version" dropdown from dBASE III+ to the version your target application expects. Also check whether your target application requires a specific character encoding โ the converter writes ASCII (7-bit safe) values, which is compatible with most legacy systems but may not handle extended Latin characters correctly if the target expects a specific code page.
Use Cases by Industry
Local government and public sector
Municipal planning departments, county assessor offices, and utility districts frequently receive data from contractors in Excel but need to load it into GIS systems or legacy record-keeping platforms that accept DBF. The Excel-to-DBF converter eliminates the need for FoxPro or dedicated ETL software for these routine tasks.
Environmental consulting and land management
Field data collected in Excel โ soil sampling results, vegetation surveys, monitoring station readings โ needs to be attached to spatial features in QGIS or ArcGIS as Shapefile attribute tables. Converting the Excel dataset to DBF and placing it alongside the geometry files (.shp, .shx, .prj) is the standard workflow.
Accounting and finance migrations
Organizations migrating away from FoxPro-based or dBASE-based accounting systems often need to reload historical transaction data into the new system through the legacy platform's DBF import function during a parallel-run period. Finance teams prepare the data in Excel, then convert to DBF for import.
Real estate and property management
Property databases, parcel records, and tax roll data are commonly distributed in Shapefile format with DBF attribute tables. When updating these datasets from Excel exports from county assessors or GIS vendors, the Excel-to-DBF path is the standard intermediary step.
Logistics and supply chain
Legacy warehouse management systems (WMS) and routing applications built on dBASE or FoxPro accept inventory updates, routing tables, and rate tables as DBF files. Operations teams who manage this data in Excel need a reliable conversion path.
GIS and Shapefile Workflows
The most common production use of Excel-to-DBF conversion is building or replacing the attribute table component of an Esri Shapefile. A Shapefile is a collection of files that share a base name:
.shpโ geometry (point, line, or polygon coordinates).shxโ spatial index.dbfโ attribute table (one row per geometry feature).prjโ coordinate reference system definition
The .dbf component is a standard dBASE III+ file. Its record count must exactly match the geometry record count in the .shp file, and its field structure determines what attribute columns are available in the GIS application.
Building a new Shapefile attribute table from Excel
- Ensure your Excel sheet has one row per geometry feature, in the same order as the features in the
.shpfile. - Verify the row count matches exactly:
COUNT(A:A)-1(excluding header) should equal the geometry count. - Convert to DBF using the dBASE III+ version setting.
- Rename the downloaded
.dbffile to match your Shapefile's base name (e.g.,parcels.dbf). - Place it in the same directory as your
parcels.shp,parcels.shx, andparcels.prj. - Open the Shapefile in QGIS or ArcGIS โ the attribute table will populate from your converted DBF.
Row count must match exactly. If the DBF record count does not match the geometry count in the .shp file, QGIS will show an error or display features with no attributes. Double-check both counts before replacing the DBF component of a live Shapefile.
Privacy and Security
Business data in Excel files often contains sensitive information: customer names and contact details, financial figures, employee records, patient data, or proprietary operational data. The Excel-to-DBF converter processes everything locally in your browser using the Web File API, JavaScript ArrayBuffer, and the SheetJS library. Your file is read from your local filesystem into browser memory, converted, and offered for download โ all without any network transmission.
You can verify this independently: open your browser's developer tools (F12 โ Network tab), drop a file into the converter, and observe that no network request contains your spreadsheet data. The only network activity is loading the page and its static assets on first load.
This makes the tool safe for use with confidential business data, personally identifiable information (PII), financial records, or any content you cannot submit to a cloud service.
