Skip to content
</>Inblix Dev ToolsAll tools

CSV to JSON Converter Online

Paste CSV and get JSON back with the right types. Quoted fields, embedded newlines and doubled quotes are all handled, and numbers come back as numbers rather than strings.

How it works

Converting CSV to JSON looks trivial and is not. The format was designed for a fixed set of columns with no type system at all, so the parser has to make decisions that JSON then has to represent honestly.

Types come first. Every CSV value is text, but a column of numbers pasted back as an array of strings is almost never what anyone wants. Values that are unambiguously numeric become numbers, true and false become booleans, and null becomes null. Anything ambiguous stays a string, because guessing wrong about an identifier such as a leading-zero code is worse than leaving it alone.

Quoting comes second. A field may contain the delimiter, double quotes and even line breaks, so a naive split on commas turns one row into three. This parser tracks quote state character by character, and a doubled quote inside a quoted field is read as a literal quote, so a value written as "said ""hi""" parses to said "hi" correctly.

The delimiter is detected from the header line by counting occurrences outside quotes and taking the most frequent. That matters because spreadsheets exported from European locales use semicolons, and tab-separated files show up constantly from database and analytics exports. You can override the guess with the dropdown.

Dotted headers are expanded back into nested objects, which makes this the exact inverse of the JSON to CSV tool. A column called address.city produces a real nested object rather than a key containing a dot, so a round trip returns the structure you started with.

Use the CSV to JSON Converter

JSON
Paste csv on the left to see the result.

Try an example:

Runs entirely in your browser — nothing you paste is uploaded or logged.

Worked examples

Real input and the exact output this page produces.

Example 1

CSV

                      id,name,active
1,Ada,true
2,Grace,false
                    

JSON

                      [
  {
    "id": 1,
    "name": "Ada",
    "active": true
  },
  {
    "id": 2,
    "name": "Grace",
    "active": false
  }
]
                    

Example 2

CSV

                      name,notes
"Lovelace, Ada","line one
line two"
                    

JSON

                      [
  {
    "name": "Lovelace, Ada",
    "notes": "line one\nline two"
  }
]
                    

Frequently asked questions

Are the values typed, or all strings?

Numbers, true, false and null are converted to their JSON equivalents. Anything ambiguous, such as a leading-zero code, is left as a string so it is not corrupted.

How does it handle commas inside quoted fields?

The parser tracks quote state, so a value like Lovelace, Ada stays a single field instead of splitting into two columns.

What happens with newlines inside a cell?

They are preserved. A quoted field spanning two lines is read as one value containing a newline, which is valid RFC 4180 and common in exports from spreadsheets.

Does this reverse the JSON to CSV tool?

Yes. Dotted headers such as address.city are expanded back into nested objects, so converting to CSV and back returns the shape you started with.

Others doing similar work.