CSV to JSON converter

Turn a CSV or TSV file into JSON you can feed to an app or API. The first row becomes the keys, the delimiter is detected for you, and quoted cells with commas or line breaks inside are read correctly. Runs in your browser.

Loading…

Worked example

A three-column export. The roles cell holds a JSON list, so with type detection on it comes back as a real array; without it the cell stays a string.

csv
id,name,roles
1,Ada,"[""admin"",""editor""]"
2,Grace,[]
json
[
  {
    "id": "1",
    "name": "Ada",
    "roles": "["admin","editor"]"
  },
  {
    "id": "2",
    "name": "Grace",
    "roles": "[]"
  }
]

Common mistakes

  • Expecting numbers to survive CSV

    CSV stores only text, so every cell is a string until Detect numbers and true/false is on. Even then, values that would change stay text: 007 keeps its leading zeros and 1.10 keeps its trailing zero.

  • Leaving Header row on for data without one

    The first row of real data becomes the keys and disappears from the result. Turn Header row off to get an array of arrays instead.

  • Ignoring the line and column in an error

    An unclosed quote almost always means an export or paste dropped a closing quote, and every row after it reads wrong. The error names the line and column where the quote opened; fix the source there, not by editing later rows.

  • Reformatting before converting

    There is no need to clean the file first. A byte order mark, CRLF or LF endings, blank lines and quoted line breaks are all handled; converting the original export avoids introducing new mistakes.

How it works

  1. 1

    Paste or open the CSV

    Any standard CSV or TSV: comma, semicolon or tab separated, with Windows or Unix line endings. The delimiter is detected unless you pick one yourself.

  2. 2

    Set how the rows are read

    Keep Header row on to use the first row as the keys of each object, or turn it off for an array of arrays. Detect numbers and true/false converts 42, true and null; Nest dotted keys rebuilds columns like address.city into nested objects.

  3. 3

    Copy or download the JSON

    One object per row, formatted with 2-space indentation. Blank or repeated column names are given unique keys, and short rows are padded with empty strings, so no cell is silently dropped.

Questions

What JSON do I get back?
With a header row, an array of objects: each row becomes one object keyed by the column names. Without one, an array of arrays, one inner array per row, so position carries the meaning.
Can it read cells that contain commas or line breaks?
Yes. Standard CSV quoting is followed (RFC 4180): a field wrapped in double quotes may contain the delimiter, doubled quotes and line breaks. A quote that is never closed is reported with the line and column where it opened, and the Go to error button jumps there.
How do I get numbers instead of strings?
Turn on Detect numbers and true/false. Values like 42, 3.14, true, false and null become JSON values, and cells holding a JSON list or object are read back as such. Anything that would change as a number stays text: IDs with leading zeros like 007, values like 1.10, and numbers too long to store exactly.
The whole file landed in one column. What happened?
The delimiter guess was wrong, which happens with files that mix separators. Pick the delimiter yourself in the toolbar: Comma, Semicolon or Tab. Semicolons are common in exports from Excel in many European locales.
What about nested data, like an address.city column?
Turn on Nest dotted keys and columns with dots in their names become nested objects again, so address.city ends up as {"address": {"city": ...}}. Names that would clash or have an empty part stay flat.
Is my file uploaded anywhere?
No. The conversion runs in this tab; your data never leaves your browser. The page sends only cookieless usage counts (which page and tool, plus basic browser details), never your input. Microsoft Clarity also records clicks and scrolling to show how pages are used, with tool areas hidden.

Sources

The standards and references the tool and the answers above are based on.