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

How to Use the Json To Dbf: Step-by-Step Tutorial

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

The Json To Dbf Converter runs entirely in your browser โ€” your JSON file is never sent to any server, no account is required, and no data leaves your device. This tutorial walks through every step: loading a JSON array file, running the conversion, reading the stats panel, reviewing the inferred schema, and downloading the DBF. It also covers the most common problems you will encounter and how to resolve them.

Connect on LinkedIn โ†’

Follow along with the tool open: Open the Json To Dbf Converter in a second tab, then work through each step below.

Open Json To Dbf Converter โ†’

Table of Contents

  1. Step 1 โ€” Open the Tool
  2. Step 2 โ€” Prepare and Load Your JSON File
  3. Step 3 โ€” Click Convert to DBF
  4. Step 4 โ€” Read the Stats Panel
  5. Step 5 โ€” Review the Inferred Schema Table
  6. Step 6 โ€” Download the DBF
  7. Troubleshooting Common Problems
  8. Worked Example

Step 1 โ€” Open the Tool

Navigate to /developer-tools/json-to-dbf/. The tool loads entirely in your browser. After the initial page load, converting a file makes no outbound network requests โ€” you can verify this in your browser's DevTools Network panel while the conversion runs.

The tool is accessible from the Developer Tools hub, the command palette (press Ctrl+K or โŒ˜K and type "Json To Dbf"), or directly via the URL above.

Step 2 โ€” Prepare and Load Your JSON File

The converter accepts a JSON file where the top-level value is an array of flat objects. Every element of the array must be a plain object; nested arrays and nested objects as values will be serialized to a string before being written to the DBF Character field.

A minimal valid input looks like this:

[
  { "id": 1, "name": "Alice",   "active": true  },
  { "id": 2, "name": "Bob",     "active": false },
  { "id": 3, "name": "Carol",   "active": true  }
]

Load the .json file using one of two methods:

Once the file is loaded, the filename appears in a bar below the drop zone. The drop zone itself hides to keep the interface clean. To replace the file, click the โœ• button in the filename bar โ€” this clears the loaded file and returns the drop zone so you can load a different one.

The tool accepts only .json files. If you drop a file with a different extension, a red error badge explains the problem. If your JSON is embedded in another file or a string in memory, copy it to a .json file first (pbpaste > data.json on macOS, or paste into a new file in any text editor).

Step 3 โ€” Click Convert to DBF

Once a file is loaded, click the Convert to DBF button. The conversion pipeline runs immediately in the browser:

  1. The file is parsed with JSON.parse. If the file is not valid JSON or the root is not an array, an error is reported before any further processing.
  2. Every key across every record is collected to build the union field set. For each field, every non-null value is scanned to infer the dBASE type: Logical (all booleans), Numeric (all numbers), or Character (anything else, or mixed types).
  3. A 32-byte file header and a 32-byte descriptor per field are assembled in a Uint8Array buffer. A 0x0D terminator closes the header.
  4. Each record is serialized as a fixed-length row: leading space byte (active), then each field value formatted for its type and padded to its declared length. A 0x1A end-of-file byte closes the buffer.

For a JSON file with a few thousand records and 10โ€“20 fields, the conversion typically completes in well under a second. The button is disabled during processing to prevent accidental double-clicks.

Step 4 โ€” Read the Stats Panel

After a successful conversion, a green stats panel appears with the key numbers:

Step 5 โ€” Review the Inferred Schema Table

Below the stats panel, a schema table lists every field alongside its inferred DBF type, length, and decimal count. This is the single most important table to review before using the DBF.

The cases to look for:

If the schema table is empty, the JSON array was empty โ€” there were no records to build a schema from. Check your input file; a valid empty-array JSON ([]) parses successfully but produces a zero-record DBF with no fields, which most DBF readers will reject.

Step 6 โ€” Download the DBF

Click the green Download DBF button. The browser saves the file to your default downloads folder. The filename is constructed by replacing the .json extension of the input file with .dbf. For example, customers.json becomes customers.dbf.

After downloading, open the file and spot-check it before using it in production:

Troubleshooting Common Problems

"Invalid JSON โ€” failed to parse." The file could not be parsed as JSON. Common causes: trailing commas (invalid in strict JSON), single-quoted strings (JSON requires double quotes), unescaped control characters, or BOM bytes at the start of the file. Run your JSON through the JSON Validator to find the exact syntax error and line number.

"Expected an array at the top level." The root of the JSON is an object or a scalar rather than an array. The converter requires an array of objects. If your data is an object with a single array property (e.g., {"records": [...]}), extract the inner array to a new file, or use jq '.records' data.json > flat.json to flatten.

Unexpected Character type for a numeric-looking column. This means at least one value in that column is not a JSON number. Check for null values (allowed โ€” these don't force Character), empty strings, or values wrapped in quotes ("42" is a string, 42 is a number). Clean the source JSON so every non-null value in the column is a bare number.

"Character value truncated โ€” exceeded 254 bytes." Classic DBF Character fields have a hard 254-byte cap. If your data has longer text values, either truncate at the source, emit a Memo field using a tool that supports .dbt, or use JSON to CSV instead โ€” CSV has no per-field byte limit.

DBF reader shows garbled non-ASCII characters. The converter writes strings as UTF-8 bytes, but older DBF readers default to a single-byte codepage (CP437 or Windows-1252). Create a sibling file with the same base name as your DBF and extension .cpg containing the single line UTF-8. Modern readers will pick up the codepage hint automatically.

QGIS shows only some rows in the attribute table. QGIS matches attribute rows to geometry rows by index, so a DBF intended to pair with a .shp file must have exactly the same record count as the shapefile. If the DBF row count differs from the shapefile, QGIS silently drops rows. Regenerate the DBF with a record count matching the geometry file.

Field names unexpectedly uppercase or truncated. DBF field names are 11 bytes, ASCII, and uppercase by convention. The converter applies both rules. Starting with DBF-friendly keys (CUST_ID, ORDER_NUM) in your source JSON avoids surprises in the output schema.

Worked Example

The following example shows a complete conversion using a small, representative JSON file.

Create the sample JSON file:

[
  { "ORDER_ID": 1001, "CUSTOMER": "Alice", "AMOUNT": 149.99, "SHIPPED": true  },
  { "ORDER_ID": 1002, "CUSTOMER": "Bob",   "AMOUNT":  32.50, "SHIPPED": true  },
  { "ORDER_ID": 1003, "CUSTOMER": "Carol", "AMOUNT": 210.00, "SHIPPED": false }
]

Save this content as sample_orders.json on your machine. The field names are intentionally DBF-friendly (uppercase, โ‰ค11 bytes, underscore-separated) so the output schema matches what you wrote.

Convert using the tool:

  1. Open the Json To Dbf Converter.
  2. Drag sample_orders.json onto the drop zone, or click browse and select it.
  3. The filename bar shows: ๐Ÿ“Ž sample_orders.json.
  4. Click Convert to DBF.
  5. The stats panel shows: Records: 3 ยท Fields: 4.
  6. The inferred schema table shows: ORDER_ID (Numeric, length 4, decimals 0), CUSTOMER (Character, length 5), AMOUNT (Numeric, length 6, decimals 2), SHIPPED (Logical, length 1).
  7. Click Download DBF. The file is saved as sample_orders.dbf.

Verify the output: Open sample_orders.dbf in QGIS, LibreOffice Calc (with the dBASE filter), or the DBF Validator. You should see a 4-field, 3-record table. ORDER_ID values are right-aligned integers. CUSTOMER values are left-aligned and space-padded to 5 bytes. AMOUNT values are right-aligned with two decimal places. SHIPPED contains T or F.

If you want to see what happens with a mixed-type column, replace one AMOUNT value with the string "TBD" and re-convert. The field will be promoted to Character, with the numeric values written as their decimal string representations. This is the converter's fallback for inconsistent columns โ€” and a good example of why the schema table is worth reviewing before download.

For a deeper explanation of the DBF format, field type inference, and character encoding, see the Complete Guide to Json To Dbf.

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