File Converters ⏱️ 6 min read • Nov 02, 2026 • 2 views

CSV to JSON: Headers, Quoted Fields & Data Types Explained

A practical CSV to JSON guide with examples, delimiter selection, quoted fields, leading-zero identifiers, optional type conversion, and common parsing errors.

Advertisement

Convert spreadsheet exports into JSON you can use

A CSV export is convenient for moving a table between spreadsheets, but an application import or API test often needs JSON. Our CSV to JSON Converter turns each row into a JSON record. It runs in the browser, accepts pasted data or UTF-8 files, and lets you inspect a small preview before downloading the complete result.

Start with a small sample when configuring an import. Check column names and a few representative values before processing the full dataset. A successful parse tells you that the structure is readable; it does not verify that the source data is correct for your application.

A CSV to JSON example

Consider this small export. The ID contains leading zeros, and the second name contains a comma:

id,name,active
00123,Ana,true
00456,"Pop, Mihai",false

With header mode enabled and type conversion disabled, the result is:

[
  {"id": "00123", "name": "Ana", "active": "true"},
  {"id": "00456", "name": "Pop, Mihai", "active": "false"}
]

The first row provides property names. Subsequent rows supply values in the same column order. Enable optional type conversion if your target expects booleans rather than the strings "true" and "false".

Choose the delimiter and header mode

Load your file or paste spreadsheet cells into the input editor. Auto-detection compares commas, semicolons, tabs and pipes in the first nonempty record, ignoring separators inside quoted fields. If your file uses unusual headers or produces an unexpected column count, choose the delimiter explicitly.

Leave First row contains headers enabled for named JSON objects. Turn it off when every row is data and you want arrays, such as [["Ana", "Paris"], ["Mihai", "Bucharest"]]. Blank lines are skipped; deliberately quoted empty values are retained.

Header names are trimmed and must be nonempty and unique. Rename duplicate columns before conversion. For example, replace two columns both called name with first_name and last_name so neither value can overwrite the other.

Handle quotes, commas and multiline fields

Under the conventions documented in RFC 4180, a field containing a comma, quote or line break can be enclosed in double quotes. A quote within that field is escaped by doubling it. The converter supports these quoting conventions with each supported delimiter.

name,note
Ana,"Said ""hello"" at the meeting"
Mihai,"First line
Second line"

A line break inside a quoted value belongs to that value. This is why splitting CSV text on every newline and comma can corrupt an otherwise valid file. Keep closing quotes directly next to the following delimiter or record ending; unexpected characters after a closing quote are reported as an error.

Preserve IDs and choose data types deliberately

The default is to keep values as strings. This preserves postal codes, account references and product IDs exactly as text. An empty CSV value becomes "", not zero and not null. Dates also stay as text; the converter does not guess time zones or date formats.

The optional conversion setting recognizes lowercase true, false and null, plus JSON-style numbers. Leading-zero IDs and integers outside JavaScript’s safe range remain strings. Decimal numbers are subject to JavaScript numeric precision: long fractional values or very small exponents can be rounded. Keep type conversion off when exact decimal text matters.

RFC 8259 describes JSON value types and numeric interoperability considerations. Check the receiving application’s schema before choosing types; a valid JSON number is not necessarily an appropriate identifier.

Troubleshoot common conversion errors

  • Wrong number of fields: Check the selected delimiter and look for an unquoted separator. The converter stops at the inconsistent record rather than dropping extra fields.
  • Unclosed quoted field: Find the opening quote and add its matching closing quote. Double any quote that should be part of the value.
  • Empty or duplicate header: Give every column a distinct name, or disable header mode to produce arrays.
  • Unreadable file: Export as CSV UTF-8. Renaming an Excel workbook to .csv does not turn it into a text file.
  • File or row limit exceeded: This tool accepts up to 5 MB, 50,000 data rows and 1,000 columns, with JSON output capped at 20 MB. Use Split CSV File for larger exports.

Review and export

After conversion, compare the row count with the source. Inspect the first five records, then search the JSON output for important IDs or special characters. The preview shows at most six columns to stay manageable on a small screen; the downloaded JSON includes every converted row and column. Compact output removes indentation without changing values.

Copy the JSON or download a .json file. Changing input or options clears the previous result so you cannot accidentally export an outdated conversion. Processing does not upload the dataset or save it in browser storage. If your organization requires a fully offline workflow, use an approved offline tool.

For the reverse workflow, use JSON to CSV. To inspect an existing JSON document, open JSON Beautifier. Ready to convert your export? Open the free CSV to JSON Converter.

Advertisement
⚡

Ready to Format Data Faster?

Experience instant, 100% private in-browser delimiter tools, SQL conversions, and file converters with zero server uploads.

Comma Separator Tool → Explore All Tools

Related Guides & Tutorials

File Converters

The Ultimate CSV Delimiter Guide: Commas, Semicolons, Pipes & Tabs

Read →
File Converters

Converting XML to JSON and CSV: A Developer's Practical Guide

Read →
File Converters

The Complete Guide to Image Formats: When to Use WebP, PNG, JPG & SVG

Read →