PrettyJSON Logo
PrettyJSON

Instantly clean, validate, and inspect web payloads

CSV Input
JSON Output

Waiting for CSV input

Paste CSV on the left or load the sample to see JSON instantly.

100% Client-Side & Private

Convert CSV to JSON Online

Convert CSV — an export from Excel, Google Sheets, a database, or an analytics tool — into a clean JSON array of objects. The header row becomes the object keys, each following line becomes an object, and PrettyJSON infers types so 30 is a number and true is a boolean rather than quoted strings. Quoted fields containing commas or newlines are parsed correctly, and it all happens locally in your browser.

Real types, not strings

Numbers and booleans are inferred, so 30 and true arrive as JSON types rather than the strings "30" and "true".

Keep your leading zeros

Wrap ZIP codes, phone numbers, or IDs in quotes in the CSV so 007 stays "007" instead of collapsing to the number 7.

Real-world CSV quoting

Quoted fields may hold commas, line breaks, and escaped quotes; blank lines are skipped and the first row becomes the keys.

How to convert CSV to JSON

A quick walkthrough and the details that matter.

Steps

  1. Paste CSV that includes a header row, or upload a .csv file.
  2. Each row is mapped to a JSON object keyed by the header names, with types inferred.
  3. Copy the JSON array or download it as a .json file.

Automatic type inference (and when to be careful)

Numbers, booleans, and empty values are detected automatically, so numeric IDs and true/false flags land as real JSON types instead of strings. One thing to watch: a value like the zip code 07030 is read as the number 7030 and loses its leading zero. If a column must stay textual — zip codes, phone numbers, order IDs — quote those values in the source CSV so they are preserved as strings.

Quoting, delimiters, and the header row

Standard CSV rules apply: a field wrapped in double quotes may contain commas, embedded line breaks, and escaped quotes without breaking the row, and blank lines are skipped. The first non-empty line is always treated as the header that names your keys, so make sure your data starts with a header row rather than a data row.

Example: CSV in, JSON out

A before-and-after using sample CSV.

CSV input
id,name,active,score
1,Ada,true,9.5
2,Linus,false,8
JSON output
[
  { "id": 1, "name": "Ada", "active": true, "score": 9.5 },
  { "id": 2, "name": "Linus", "active": false, "score": 8 }
]

Frequently Asked Questions

Common questions about converting CSV to JSON.

Does my CSV need a header row?

Yes. The first non-empty row is treated as the field names, and every subsequent row becomes a JSON object using those names as keys.

Are numbers and booleans converted automatically?

Yes. Type inference is on, so numeric values become JSON numbers and true/false become booleans. Note that this can strip leading zeros from codes — quote those fields in the CSV if you need them kept as strings.

How are quoted fields with commas or line breaks handled?

They are parsed correctly. A field enclosed in double quotes may safely contain commas, newlines, and doubled quotes ("") without splitting into extra columns.

Is the CSV processed on a server?

No. The entire conversion runs in your browser, so a spreadsheet full of customer or financial data is never uploaded or stored anywhere.