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
Choose the delimiter: Comma, Tab, or Semicolon.
- 2
Paste your CSV with the header row first.
- 3
Check the JSON output panel.
- 4
Click Copy to copy the JSON array.
Worked examples
Comma-separated
A small contact list.
Ages stay as strings; convert them in your code if you need numbers.
Semicolon with decimal commas
A European price list.
Quoted comma (not supported)
A name containing a comma.
The comma inside quotes is treated as a delimiter. Switch to Tab or Semicolon if your data contains commas.
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.