Skip to content
← All Tools
๐Ÿ”’All processing in your browser ๐ŸšซNo uploads stored ๐Ÿ›ก๏ธPrivacy-first conversion tools โœ“No login required
Guide

The Complete Guide to Json To Dbf: Everything You Need to Know

Bill Crawford — Developer Guide — 2026  ยท  Published April 16, 2026

JSON is the lingua franca of modern web APIs, JavaScript applications, and configuration files. DBF โ€” the dBASE database format โ€” predates JSON by two decades and remains the data substrate for QGIS attribute tables, ArcGIS shapefiles, FoxPro applications, and a long tail of legacy accounting, inventory, and records systems. The two formats are separated by a generational gap in tooling, but they meet in a surprisingly large number of practical workflows: GIS pipelines, legacy system integrations, and any environment where modern JSON output must feed a tool that speaks only dBASE.

The gap creates a concrete problem: a developer produces a JSON array of objects from an API, a database query, or a fake data generator, and a downstream tool โ€” a GIS layer editor, a vintage FoxPro report generator, an archival records system โ€” accepts only DBF. Manually writing a DBF file is non-trivial: the format specifies a fixed-width binary header, field descriptors with exact byte offsets, per-field type codes, and a padded record layout with a specific terminator. Converting JSON to DBF on the command line typically means installing a Python library like dbfread or simpledbf, writing a small script, and handling type inference by hand.

The JSON to DBF Converter on this site does the conversion entirely in your browser. Drop in a .json file containing an array of objects, and it writes a valid dBASE III .dbf file with field types inferred automatically from your data. No upload, no server processing, no login. This guide explains the DBF format, how the converter infers field types, what limitations matter, and the best practices developers should follow when producing DBF output for GIS and legacy systems.

Connect on LinkedIn โ†’

Convert JSON to DBF instantly: Drop a .json file containing an array of objects onto the converter. It infers field types automatically, writes a valid dBASE III .dbf file, and triggers a browser download โ€” free, private, no uploads.

Open Json To Dbf Converter โ†’

Table of Contents

  1. What Is the DBF Format?
  2. JSON vs. DBF: Key Differences
  3. How the Conversion Works
  4. Field Types and Inference Rules
  5. Character Encoding and the 254-Byte Limit
  6. Common Use Cases
  7. Best Practices
  8. Limitations and Edge Cases

What Is the DBF Format?

DBF is a binary, fixed-width, row-oriented database file format originally defined by the dBASE database management system in 1980. The format was extended by subsequent dBASE versions (III, IV, 5, 7), adopted by FoxPro and Visual FoxPro, and became the de facto attribute-table format for ESRI shapefiles โ€” meaning that every shapefile you see in the wild carries a companion .dbf file holding the non-geometric attributes of each feature.

The physical structure of a DBF file is straightforward:

JSON vs. DBF: Key Differences

Understanding the structural differences between the two formats explains why type inference is necessary and why certain JSON constructs do not translate directly.

How the Conversion Works

The JSON to DBF Converter parses your JSON file, infers a schema from the data, then writes a binary DBF file byte-by-byte using a Uint8Array buffer. The pipeline has four stages.

Stage 1 โ€” JSON parse and shape validation. The uploaded file is read into a string using the Web File API, then parsed with JSON.parse. The root value must be an array; if it is an object or a scalar, the converter reports an error. Every element of the array must be a flat object (no nested arrays or objects as values). Elements that violate this shape either trigger an error or, depending on context, are serialized to a JSON string for storage in a Character field.

Stage 2 โ€” Schema inference. The converter takes the union of keys across all objects โ€” the superset of fields that will appear in the DBF. For each field, it scans every value across all records to determine the dBASE field type. The inference rules are deterministic and documented in the next section. After scanning, the converter knows the field name, type code (C, N, L), length, and decimal count for every column.

Stage 3 โ€” Header construction. The 32-byte file header is assembled with the current date, the record count, the computed header length (32 + 32 ร— field count + 1), and the computed record length (1 + sum of field lengths). The field descriptor array is constructed one descriptor at a time, each 32 bytes of null-padded name, type code, length, and decimal count. A 0x0D terminator byte closes the header.

Stage 4 โ€” Record serialization. For each input object, the converter writes a fixed-length record. The leading byte is 0x20 (active). Each field value is formatted according to its type: numeric values are right-aligned and left-padded with spaces; character values are written as-is and right-padded with spaces; logical values become T or F; null values become spaces. A final 0x1A byte closes the file. The complete Uint8Array is wrapped in a Blob with application/x-dbase MIME type and offered for download.

The entire pipeline runs in the browser's JavaScript engine. The JSON file is read into memory and never transmitted to any server. For a JSON file with a few thousand records and 10โ€“20 fields, conversion typically completes in well under a second.

Field Types and Inference Rules

Field types are assigned by scanning all values present for a given key across every record. The rules are:

The converter displays a schema summary after processing โ€” field name, type code, length, and decimal count โ€” so you can confirm the inference before downloading. If the inferred schema is wrong (for example, an ID column with a leading-zero code has been typed as Numeric, causing loss of the leading zero), adjust the input JSON to force string values and re-convert.

Character Encoding and the 254-Byte Limit

The DBF format predates Unicode. Classic dBASE III files store bytes interpreted by the current codepage โ€” typically CP437 on DOS or Windows-1252 on Windows. Strings containing characters outside the basic ASCII range (accented Latin characters, Greek, Cyrillic, CJK) may be displayed as mojibake in a DBF reader that uses a different codepage than the writer.

The converter writes strings as UTF-8 bytes. Readers that understand UTF-8 (QGIS with a .cpg sidecar file specifying UTF-8, modern FoxPro extensions) will display the data correctly. Readers that assume a single-byte codepage will misdisplay multi-byte characters. If you are writing DBF for a known legacy system, verify its codepage expectation before delivering the file.

The per-field 254-byte cap is a hard structural limit of classic DBF. The converter truncates Character values that exceed 254 bytes and displays a warning listing the affected fields. If a column routinely contains longer text values, a classic DBF file is the wrong format โ€” either use a Memo field (not supported by this converter, but available in dBASE IV and FoxPro .dbt extensions) or switch to JSON to CSV, which preserves full string length without field limits.

Common Use Cases

Feeding attribute data into QGIS and ArcGIS. An ESRI shapefile is a set of files (.shp, .shx, .dbf, and optional .prj/.cpg) where the .dbf carries non-geometric attributes. If you generate geospatial records programmatically from an API or a JSON data source, converting the attribute table to DBF lets QGIS or ArcGIS ingest it alongside the geometry file.

Legacy accounting and inventory systems. FoxPro and dBASE IV remain deployed in vertical-market software for accounting, insurance, records management, and point-of-sale. Modern ETL pipelines often produce JSON; converting that output to DBF allows it to be ingested by a legacy reporting tool or archival system without writing custom adapter code.

Quick one-off data handoffs. A developer who needs to hand tabular JSON to a colleague running software that only reads DBF can do the conversion here without writing a Python script or installing a command-line tool. Common scenarios: delivering data to a GIS consultant, preparing a file for import into a legacy records system, or producing a regression-test fixture for a DBF-consuming application.

Archival and digital-preservation work. Libraries, archives, and government records offices frequently receive modern data in JSON but store it alongside legacy collections whose format is DBF. Converting incoming data to the archive's working format keeps the collection uniform and avoids future format drift.

Regression fixtures for DBF-consuming code. A developer maintaining a tool that parses DBF needs small, hand-crafted test files. Writing a JSON array with the desired records and converting it to DBF is faster than learning a DBF-writing library for a one-off test fixture.

Best Practices

Validate the JSON structure before converting. The converter expects an array of flat objects. If you are not certain the file matches that shape โ€” for example, the JSON came from an automated export that may include nested structures โ€” use the JSON Validator first to confirm the file parses cleanly. An early validation saves debugging a confusing DBF output.

Inspect the schema summary before downloading. The converter displays a field summary with inferred types and lengths. Skim this table before downloading. Common surprises: an ID column typed as Numeric (when leading zeros mattered), a date column stored as Character (because it was a string in JSON), or a field marked Character 254 because one record happened to exceed the limit.

Force types explicitly in the source JSON. The converter infers types by scanning values. To force a column to a specific type, control the JSON: wrap all values in quotes to force Character; ensure every value is a JSON number to force Numeric; use true/false consistently to force Logical. Mixed types across records will always fall back to Character.

Uppercase and shorten field names in the JSON. DBF field names are 11 bytes, ASCII, uppercase by convention. The converter will truncate and uppercase long JSON keys, but starting with DBF-friendly names (CUST_ID, ORDER_NUM) makes the output schema predictable and avoids silent collisions where two long JSON keys truncate to the same 11-byte prefix.

Supply a .cpg sidecar for UTF-8 DBFs. If your DBF output will be read by QGIS, ArcGIS, or a modern FoxPro environment, deliver a sibling text file named <name>.cpg containing the single line UTF-8. Without this, many GIS tools assume Windows-1252 and misdisplay non-ASCII characters.

Verify with the DBF Validator. After conversion, pass the output through the DBF Validator to confirm the header is well-formed, record count matches expectations, and field definitions are what you intended. This catches cases where the source JSON had structural quirks that the converter tolerated but a downstream reader may not.

Limitations and Edge Cases

Nested objects and arrays. DBF has no concept of nested data. If a JSON value is an object or an array, the converter serializes it to a JSON string and writes it into a Character field. The string may exceed 254 bytes and be truncated. For data with any real nesting, flatten the structure in the source JSON (use JSON to CSV for an intermediate flat representation) before converting.

Date types. Classic DBF has a dedicated D (Date) type stored as 8-byte YYYYMMDD. The converter does not emit D fields โ€” ISO date strings in JSON are stored as Character. If your downstream system expects genuine D fields, post-process the DBF with a library that can alter the field descriptor in place.

Memo fields. DBF Memo fields hold text values longer than 254 bytes by referencing a separate .dbt file. The converter does not emit Memo fields โ€” it truncates overly long Character values instead. For datasets with long text columns, DBF is not the correct output format.

Very large files. The converter reads the entire JSON file into browser memory and assembles the entire DBF in a single Uint8Array. Files with hundreds of thousands of records may exceed available memory on low-RAM devices. For large-scale batch conversions, a Python script using dbfpy or simpledbf is more appropriate.

Numeric precision. DBF Numeric fields are stored as ASCII decimal strings with a fixed total length and decimal count. Very long integers (more than 18 digits) or high-precision decimals exceed the format's practical range and will be truncated. For scientific or financial data requiring exact decimal representation, consider emitting a CSV and post-processing with a native DBF writer that supports extended precision modes.

Field-name collisions. Two JSON keys that share the same first 11 ASCII characters after uppercasing will produce duplicate DBF field names, which most readers handle poorly. The converter does not currently disambiguate โ€” the last-written descriptor wins. Rename your JSON keys to avoid collisions if this matters.

BC
Bill Crawford
Founder, Data Conversion Center

Bill Crawford is a data systems developer and technical founder with over 30 years of professional experience in accounting, finance, and business operations. He founded DataConversionCenter.com to build practical, browser-based tools that simplify complex data challenges.

Professional Background