Developer Tools

CSV to JSON Converter

This tool turns a CSV file into JSON. The parsing handles the cases that break naive splitting — a comma inside a quoted field, a doubled quote, a newline within a value. The type conversion is where most converters do damage: turning 007 into the number 7 destroys a zip code, a phone number or a part code, so values that would not survive the round trip are kept as text.

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

Delimiter

Guessed from the file's content.

JSON indent

How to

How to use the CSV to JSON

  1. 1

    Paste or load your CSV

    Drop in a .csv file or paste the text. The delimiter is detected automatically, and can be overridden if the guess is wrong.

  2. 2

    Say whether there is a header row

    With a header, each row becomes an object keyed by column name. Without one, columns are named column_1 upwards.

  3. 3

    Choose type conversion

    Numbers and booleans can be converted from text. Values with leading zeros are always left as strings, since converting them loses information.

  4. 4

    Copy the JSON

    Copy the result or download it. Any rows the parser could not read cleanly are reported with their line numbers.

Examples

CSV to JSON examples

A zip code

Input
zip 007
Output
[{"zip":"007"}]

Converting this to the number 7 would lose the leading zeros permanently. Any value that would not print back identically is kept as text.

A comma inside a quoted field

Input
name,note Ada,"Hello, world"
Output
[{"name":"Ada","note":"Hello, world"}]

Splitting on commas would produce three fields and misalign the row. Proper CSV parsing treats the quoted section as one value.

Duplicate column names

Input
a,a,b 1,2,3
Output
[{"a":1,"a_2":2,"b":3}]

Two columns with the same name would overwrite each other in an object. The second is renamed so no data is lost.

Why use it

What the CSV to JSON gives you

Identifiers survive

Zip codes, phone numbers and part codes with leading zeros stay as text rather than being silently converted to numbers.

Real CSV parsing

Quoted fields, doubled quotes and newlines inside values are all handled, which is where hand-rolled splitting always fails.

No columns lost

Blank and duplicate headers are given usable unique names instead of collapsing into one another.

Runs in your browser

Spreadsheet exports are usually real records. Nothing is uploaded.

Good to know

CSV to JSON limitations

  • Type inference is a guess. A column of numeric-looking codes without leading zeros will still be converted to numbers.
  • Very large files are held in memory as text and as parsed objects, so a huge export may be slow.
  • Character encoding is whatever the browser decoded the file as; a Latin-1 export may show damaged accents.
  • Excel's own quirks on export — such as a leading byte order mark — are handled, but its date reformatting cannot be undone here.

Summary

CSV to JSON in short

  • Leading zeros are preserved, so 007 stays a string.
  • Quoted fields containing commas, quotes and newlines parse correctly.
  • Duplicate and blank headers are made unique rather than collapsing.
  • The delimiter is detected automatically and can be overridden.
  • Everything runs in your browser.

FAQ

CSV to JSON questions

Why is 007 kept as a string?

Because converting it to a number loses the zeros permanently, and a value with leading zeros is almost always an identifier — a zip code, a phone number, a part code — rather than a quantity. Only values that print back identically are converted.

How are commas inside a field handled?

A field wrapped in quotes may contain the delimiter, quotes doubled to escape them, and even line breaks. Proper parsing tracks the quoting state, which is why splitting on commas produces garbage for any real-world file.

What if my file uses semicolons or tabs?

The delimiter is detected from the content and can be set manually if the guess is wrong. Semicolons are common in European locales where a comma is the decimal separator; tabs appear when data is pasted from a spreadsheet.

What happens if two columns have the same name?

The second is renamed with a numeric suffix. Left alone, the later column would overwrite the earlier one when each row became an object, and the loss would be completely invisible.

Can I convert a file with no header row?

Yes. Turn the header option off and columns are named column_1, column_2 and so on. Getting this wrong is easy to spot — your first data row becomes the key names.

How are empty cells represented?

As null by default, which distinguishes an empty cell from an empty string. That can be turned off if your consumer treats null and empty string differently.

Why are accented characters damaged?

The file was probably saved as Latin-1 or Windows-1252 rather than UTF-8, and the browser has decoded it as UTF-8. Re-export the file as UTF-8 from the source application — the damage cannot be reliably undone afterwards.

What if some rows are malformed?

They are reported with their line numbers rather than silently dropped. A row with the wrong number of fields usually means a quote was left unclosed somewhere earlier in the file.

Is my spreadsheet data uploaded?

No. Parsing runs in this page. A CSV pasted into a converter is nearly always a genuine export of customers, staff or transactions, and none of it is transmitted.

Discover

Related developer tools