Skip to content
Tools

CSV to JSON Converter

Last updated:

Paste CSV and get a JSON array with one object per row, using the header row as the keys. Quoted fields with embedded commas, quotes and line breaks are parsed correctly, following RFC 4180.

Runs in your browser: your spreadsheet data never leaves your device – nothing is uploaded, logged or stored on a server. How we protect your data

100% in-browserNothing is uploaded

Input

Loading editor…

Paste CSV here

or drop a file anywhere in this box. Everything stays in your browser.

Drop a file to load it

Output

Loading editor…

JSON appears here

Results update as you type.

How to use the CSV to JSON

  1. Paste CSV text or drop a .csv file exported from Excel, Sheets or a database.
  2. Check the delimiter (auto-detected from the first line: comma, semicolon, tab or pipe) and whether the first row is a header.
  3. Choose whether numbers and true/false should be detected or kept as strings.
  4. Copy or download the JSON.

Worked example

A quoted name and an empty cell

CSV

name,age,city
Ada,36,London
"Hopper, Grace",85,

JSON (number detection on)

[
  {
    "name": "Ada",
    "age": 36,
    "city": "London"
  },
  {
    "name": "Hopper, Grace",
    "age": 85,
    "city": ""
  }
]

The comma inside the quotes stays part of the name. The trailing empty field becomes an empty string; with type detection off, ages would be "36" and "85".

Type detection: what changes

Type detection: what changes
CSV cellDetection onDetection off
3636"36"
truetrue"true"
007"007" (leading zero kept as text)"007"
1e31e3 (a JSON number, digits kept as written)"1e3"
(empty)""""

Delimiters and regional exports

Excel in many European locales saves "CSV" with semicolons because the comma is the decimal separator there. The delimiter is auto-detected from the first line; if every row still comes out as a single key, set it to semicolon by hand. Tab-separated files (.tsv) work the same way with the tab delimiter.

Values that should stay strings

ZIP codes, phone numbers, product codes and long IDs look numeric but are identifiers. Cells with a leading zero such as 02134 stay strings. Long numeric IDs are written with every digit, but JSON.parse in JavaScript will round them beyond 2^53. Turn type detection off when in doubt and convert specific fields in code.

Duplicate header names are renamed automatically (id, id_2), and an empty header becomes column_N, so no value is lost.

CSV to JSON FAQ

How do I convert an Excel sheet to JSON?

In Excel choose File > Save As > CSV UTF-8, then paste or drop the file here. Each sheet must be saved separately.

What if my CSV has no header row?

Turn off the header option; the output is then an array of arrays, one inner array per row. To get objects instead, add a header line to the CSV yourself.

Why does my CSV to JSON output have one huge key?

The delimiter is wrong. A semicolon- or tab-separated file read as comma-separated puts the whole line in one field. Pick the matching delimiter.

How are line breaks inside a cell handled?

A field wrapped in double quotes may contain line breaks; the parser keeps them inside the value as \n instead of starting a new row.

Can I get nested JSON from CSV?

By default the objects are flat. If your headers use dotted names like address.city or tags.0, turn on the unflatten option to rebuild nested objects and arrays (empty cells are skipped).

Related tools