Skip to content
ToolZone

CSV to JSON

Convert CSV data into structured JSON arrays, turning each row into a JSON object using the column headers as keys, ready for use in your app.

Runs in your browser. Nothing you enter or upload leaves your device.

JSON output…

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the CSV to JSON

CSV to JSON turns rows of delimited text into a JSON array, with one object per row and the header row supplying the keys. It suits quick conversions of spreadsheet exports for use in code, APIs, or test fixtures.

How it works

The input is trimmed and split into lines. The first line is split on the chosen delimiter to form the headers. Each following line is split the same way, and its values are paired with the headers by position to build an object. The result is printed as a JSON array with two-space indentation.

Every value is trimmed and has one leading and one trailing quote character (single or double) removed if present. All values are kept as strings, so numbers and booleans appear in quotes. If a row has fewer values than headers, the missing ones become empty strings; extra values beyond the header count are dropped. The splitter does not understand quoted fields, so a delimiter inside quotes still splits the value.

How to use

  1. 1

    Choose the delimiter: Comma, Tab, or Semicolon.

  2. 2

    Paste your CSV with the header row first.

  3. 3

    Check the JSON output panel.

  4. 4

    Click Copy to copy the JSON array.

Worked examples

Comma-separated

A small contact list.

Input
name,age,city Alice,30,Paris Bob,25,Berlin
Result
[ { "name": "Alice", "age": "30", "city": "Paris" }, { "name": "Bob", "age": "25", "city": "Berlin" } ]

Ages stay as strings; convert them in your code if you need numbers.

Semicolon with decimal commas

A European price list.

Input
product;price Lamp;19,99 Desk;120
Result
[{"product": "Lamp", "price": "19,99"}, {"product": "Desk", "price": "120"}] (shown here on one line)

Quoted comma (not supported)

A name containing a comma.

Input
name,note "Smith, J",hi
Result
[{"name": "Smith", "note": "J"}]

The comma inside quotes is treated as a delimiter. Switch to Tab or Semicolon if your data contains commas.

Limitations
Quoted fields are not parsed, so delimiters or line breaks inside quotes break the row. All values are output as strings; numbers, booleans, and nulls are not detected. Nested JSON structures cannot be produced from dotted or grouped headers.
Assumptions
The first row contains column headers. Each row is on a single line.
Privacy
Conversion runs in your browser; the CSV data is not uploaded.

Frequently asked questions

Does the first row need to be a header?+

Yes. The first row supplies the keys for every object, so it should contain column names rather than data.

What happens with commas inside a quoted CSV field?+

They are treated as delimiters, which splits the field. Use Tab or Semicolon as the delimiter if your values contain commas.

Why are my numbers in quotes?+

The converter keeps every value as a string. Convert types in your code, or edit the JSON afterward.

Can I paste data straight from Excel or Google Sheets?+

Yes. Copied cells are tab-separated, so choose the Tab delimiter.

What if a row has missing values?+

Missing values become empty strings, and any extra values beyond the header count are ignored.

Related tools