200 tools

Code & JSON Tools · · 4 min read

How to Convert CSV to JSON Online

Use the CSV to JSON converter to turn spreadsheet rows into a JSON array, with auto delimiter detection and number/boolean type conversion.

To convert CSV to JSON, open CSV to JSON, paste or type your comma-separated rows into the input, and the converted JSON array appears instantly — no upload, no sign-up, nothing leaves your browser.

What this tool does and why it matters

CSV is great for spreadsheets, but most APIs, config files and JavaScript code expect JSON objects. Converting by hand means writing a parser that handles quoted fields, commas inside quotes, and figuring out which values should be numbers versus strings. Toolbench's CSV to JSON tool does that parsing for you: it reads your rows, turns the first row into object keys (if you tell it to), and can automatically detect numbers and booleans so you don't get a JSON file full of quoted "42" and "true" strings.

How to convert CSV to JSON with Toolbench

  1. Open CSV to JSON.
  2. Paste your CSV into the input panel.
  3. Leave First row is header on (the default) to turn column names into object keys, or turn it off to get an array of arrays instead.
  4. Leave Detect numbers & booleans on (the default) so values like 42, 98.5, true and false become real JSON types instead of quoted strings.
  5. Set Delimiter — the default, Auto-detect, picks whichever of comma, semicolon, pipe or tab appears most in your first line. Choose Comma, Semicolon or Pipe directly if you know your data uses one of those and want to force it.
  6. Pick Indent: 2 spaces (default), 4 spaces, or Tab.
  7. Copy the resulting JSON.

Example: headers and type detection on (the defaults)

With First row is header and Detect numbers & booleans both on, this input:

name,role
Ana,Designer
Bo,Engineer

becomes:

[
  {
    "name": "Ana",
    "role": "Designer"
  },
  {
    "name": "Bo",
    "role": "Engineer"
  }
]

Each header becomes a key, and each row becomes one object in the array.

Example: numbers and booleans converted automatically

Type detection doesn't just apply to text columns — it converts any value that looks like a number or a boolean, in every column. Given:

id,name,active,score
1,Ana,true,98.5
2,Bo,false,87

the output is:

[
  {
    "id": 1,
    "name": "Ana",
    "active": true,
    "score": 98.5
  },
  {
    "id": 2,
    "name": "Bo",
    "active": false,
    "score": 87
  }
]

Notice id, active and score are unquoted real JSON numbers and booleans, while name stays a string — the tool only converts a value when it looks exactly like a number, true, false or null.

What each option changes

Option On Off
First row is header Rows become objects keyed by the header row (a blank or missing header name becomes col1, col2, …) Rows become plain arrays, with every row — including what would've been the header — converted the same way
Detect numbers & booleans 42, 98.5, true, false and null become real JSON types Every value stays a quoted string, exactly as typed
Delimiter Auto-detect scans your first line and picks whichever of , ; ` ` or tab shows up most
Indent 2 spaces (default) or 4 spaces for readable output Tab for output meant to be minified or diffed more compactly

Tips and common mistakes

  • Quoted fields with commas inside them work. "Smith, John",42 is parsed as two fields, not three — the tool respects double-quoted CSV fields, including escaped "" quotes inside them.
  • Type detection is strict about format. A value has to match a plain integer or decimal exactly (optionally with a leading - or exponent) to become a number. 007 or 1,000 won't convert — they stay strings, which is actually what you want for things like zip codes or phone numbers with leading zeros.
  • Only exact lowercase true, false and null convert. TRUE or Yes are left as strings; the tool doesn't try to guess at other boolean-ish spellings.
  • Tab-separated input needs a different tool. The Delimiter dropdown only offers comma, semicolon and pipe as forced options — if your data is tab-separated, use TSV to JSON instead, which is built for that.
  • Auto-detect looks only at your first line. If your header row happens to contain more semicolons than commas (say, inside a quoted value), auto-detect can guess wrong — pick the delimiter explicitly in that case.
  • JSON to CSV — convert a JSON array of objects back into CSV rows.
  • TSV to JSON — convert tab-separated rows, like ones pasted from a spreadsheet, into JSON.
  • XML to JSON — convert XML documents into JSON, with attributes becoming @ keys.
  • JSON Formatter — pretty-print, minify or sort keys in a JSON document.

Frequently asked questions

Does this tool send my CSV data to a server?

No. Parsing and conversion happen entirely in your browser. If you're signed in, your input syncs privately to your account; if you're signed out, nothing is saved anywhere.

What happens if my CSV has no header row?

Turn off First row is header and every row, including the one that would've been headers, is converted into a plain JSON array of values instead of an array of objects.

Why did a number in my CSV come out as a string?

Most likely it doesn't match a plain number format — leading zeros (007), thousands separators (1,000) or stray characters all keep a value as a string even with Detect numbers & booleans turned on. If you want it kept as a string on purpose (like a zip code), that's expected behavior, not a bug.

Can I control how the JSON is indented?

Yes. The Indent option offers 2 spaces (the default), 4 spaces, or a tab character.

What if my data uses tabs instead of commas?

Use TSV to JSON instead — the CSV to JSON tool's delimiter options only cover comma, semicolon and pipe.

More guides

All guides →