Private, local-first data tools

Convert CSV to JSON

Turn CSV rows into objects, two-dimensional arrays or JSON Lines, with optional type inference and explicit empty-value handling.

Processed in your browserNo account requiredEncoding and delimiter controlsIncomplete exports are blocked

Switching direction clears the current input, settings and result, and cancels any running operation. Download anything you need first.

Open or paste CSV, then export JSON or JSON Lines with explicit type and empty-cell options.

JSON export options
Empty cells can be converted to null only when type inference is enabled.
Drop a file, paste data, load a CORS-enabled URL, or try the sample.
Rows0
Columns0
EncodingAuto
DelimiterAuto
Issue groups0

Open a data file to start

The parser runs off the main thread. Once loaded, you can search, sort, validate, repair and export without an account.

Choose JSON types and output structure deliberately

CSV fields start as text. Converting them to JSON requires decisions about identifiers, numbers and missing values that CSV itself cannot express. Confirm the first-row setting before exporting: object keys come from the detected or selected headers. UseUse as header when you know the first record contains column names.

The exact type inference rules

With type inference enabled, each cell is inspected separately. There is no whole-column schema, so one column can contain both numbers and strings. Leading and trailing spaces are ignored for recognition; an ordinary text value that does not match a rule retains its original spaces.

CSV fieldJSON result with inference
true, TRUE, FalseBoolean true or false
null, NULLnull, even when empty-as-null is off
12.50, -3, 1e3Numbers 12.5, -3, 1000
00120, +12, .5Strings; these spellings do not match the numeric rule
9007199254740993, 1e309Strings; unsafe integers and non-finite results are not exported as numbers

Decimal conversion uses JavaScript numbers, not exact decimal arithmetic. Disable inference when monetary precision or the original notation must survive unchanged. Disabling it also keeps true and null as literal strings. A quoted CSV field is still eligible for inference: CSV quotation protects separators, not a JSON type.

Empty string, null and absent field are different

There are two controls, not three independent missing-value modes. With inference off, empty fields stay "" and whitespace remains unchanged; the empty-as-null checkbox has no effect. With inference on and empty-as-null off, empty or whitespace-only fields become "". With both enabled, they become null. There is no option to omit empty properties from object output.

A short row is a structural issue, not proof of an intentional null. Objects and JSON Lines supply an empty value for a missing trailing column and then apply those settings. Array output preserves the row's actual length. Entirely empty records are skipped during CSV parsing. Check malformed rows with the CSV validatorbefore treating an export as application-ready data.

A reproducible conversion example

id,active,amount,note
000184,true,12.50,
000219,false,0,null

With inference on and empty-as-null off, thenulls and booleans fixtureproduces this object array. Automated tests exercise the real worker export and parse its downloaded bytes to verify these values:

[
  { "id": "000184", "active": true, "amount": 12.5, "note": "" },
  { "id": "000219", "active": false, "amount": 0, "note": null }
]

Notice that 000184 stays an identifier, 12.50 loses its formatting zero, and the empty field differs from the word null. Theleading zeros fixtureprovides longer identifiers for a second check.

Object arrays, row arrays and JSON Lines

Choose objects when an API expects named properties. Choose arrays when a consumer expects positions: the first exported array contains headers, followed by data arrays. Array shape also preserves separate columns with identical labels. In objects or JSON Lines, exactly repeated header keys overwrite earlier values with the last column's value. Resolve duplicate headers before choosing a keyed format.

JSON Lines is useful for consumers that process one JSON object per line. It has no surrounding array or commas between records. A newline inside a CSV field becomes an escaped \n, so one record still occupies one output line:

{"id":"001","note":"first\nsecond"}
{"id":"002","note":"done"}

This output choice does not remove the workbench's 250,000-row retention limit or make its conversion streaming. Export is blocked for preview-only sessions. For the reverse direction, use JSON to CSV; for nested objects, see thenested JSON conversion guide.

What this tool does

Convert CSV to JSON

This page maps each retained CSV row to headers and generates one of three JSON shapes. Safe type inference recognizes booleans, null and numeric values without converting identifiers that start with zero.

How to use it

  1. Open or paste CSV and verify the detected header and delimiter.
  2. Choose objects, a two-dimensional array or newline-delimited JSON.
  3. Control type inference and empty cells, preview the rows and download JSON.

Common tasks

  • Convert CSV to a JSON object array, two-dimensional array or JSON Lines.
  • Preserve leading-zero IDs while safely inferring booleans, nulls and numbers.
  • Repair duplicate headers before using CSV rows as JSON object keys.

Privacy and local processing

Local files are read by a dedicated browser worker and are not uploaded to an application server. File contents and filenames are not included in analytics events. Loading a public URL is an explicit direct request from your browser and may fail when the remote server blocks CORS.

Supported edge cases

  • Values such as 000184 stay strings even when type inference is enabled.
  • Duplicate headers are reported and can be made unique before conversion.
  • JSON Lines writes one object per line and uses the .jsonl extension.

Frequently asked questions

What JSON structure should I choose?

Use objects for most APIs, arrays when positional data is required, and JSON Lines for streaming or data-engineering workflows.

Will IDs be converted to numbers?

Identifiers with leading zeros remain strings. Other unambiguous numeric values can be inferred when the option is enabled.

How are empty CSV cells represented?

They are empty strings by default, or you can export them as JSON null values.

Related CSV tools