Last updated ·Published ·By the WiserWork team

CSV to JSON Converter

Convert CSV data to JSON format with auto-detection & pretty print

Delimiter:
0 rows
0 records
Copied to clipboard!

Paste a spreadsheet export and the header row becomes object keys while every line below turns into one flat JSON object, with numbers and booleans typed automatically.

What is the CSV to JSON Converter?

CSV carries no type information at all: 42, true and an empty cell are equally just text between separators. This converter reads the first non-empty line as the header, uses those trimmed cells as keys, and walks each remaining line character by character so that separators inside double quotes are left alone. Anything reading true or false becomes a boolean, null or an empty cell becomes null, anything numeric becomes a number, and the rest stays a string. The output is always a flat array of objects, syntax-highlighted, with no nesting or dot-notation expansion.

Key Features

  • Delimiter menu: auto, comma, semicolon, tab or pipe
  • Auto mode counts separators across the first five non-empty lines
  • Quote-aware splitting keeps commas inside quoted fields intact
  • Cells reading true, false, null or blank become real JSON types
  • Upload a .csv file or download the output as data.json

Common Use Cases

  • Turning an exported contact or inventory sheet into seed data for an API
  • Checking how a messy client export parses before writing import code
  • Converting a semicolon-delimited European export without changing your spreadsheet locale
  • Building a small JSON fixture for a unit test from pasted rows

How to Use the CSV to JSON Converter

  1. Paste your rows over the sample data, or use Upload CSV to load a file.
  2. Leave Delimiter on Auto, or pick comma, semicolon, tab or pipe if detection guesses wrong.
  3. Check that your header row is the first line, since its cells become the keys.
  4. Compare the row and record counts above each panel to spot dropped lines.
  5. Press Copy JSON, or Download JSON to save the result as data.json.

Tips for Best Results

  • Leading zeros disappear: a ZIP code of 01234 is typed as the number 1234.
  • A quoted field cannot span two lines here, because the input is split on newlines first.
  • Cells past the last header are dropped, and short rows have their missing keys filled with null.
  • Swap only pushes the JSON text back into the input box; it is not a JSON-to-CSV conversion.

Why Use WiserWork's CSV to JSON Converter?

The parser is deliberately small: split on newlines, walk each line tracking whether you are inside quotes, then coerce anything that looks like a number, boolean or null. That handles the overwhelming majority of spreadsheet exports, but it is not a complete implementation of the CSV specification, so a doubled double quote used as an escape and a field containing a line break will both come out wrong. In exchange the file never leaves your browser, which matters when the export is full of customer rows.

Who Uses the CSV to JSON Converter?

Developers turning a one-off export into fixtures or seed data, analysts handed a semicolon-delimited file who need JSON for a script, and support staff inspecting a customer upload before it goes anywhere near production. It is also a quick teaching aid for showing why typed formats beat delimited text.

Frequently Asked Questions

Does the header row become the JSON keys?

Yes. The first non-empty line is treated as the header and its cells, trimmed of surrounding spaces, become the key names on every object. There is no option to treat the file as headerless.

What happens if my file has no header row?

The first row of real data will be consumed as key names and lost from the output. Add a header line before pasting, or expect one record fewer than you had rows.

Are values converted to real types or left as strings?

They are converted. Text reading true or false becomes a boolean, the word null and an empty cell become null, anything that parses as a number becomes a number, and everything else stays a string.

How does Auto delimiter detection work?

It counts how often a comma, semicolon, tab and pipe appear across the first five non-empty lines and picks whichever is most frequent, with comma winning a tie. Override it from the menu when your data contains stray semicolons or pipes.

Can it handle commas inside quoted fields?

Yes. A double quote toggles quoted mode, so a separator appearing between quotes is treated as ordinary text rather than a field break. The surrounding quotes are then stripped from the value.

What about a doubled double quote used as an escape?

That is not supported. Each quote character simply flips the quoted state, so an escaped pair is removed rather than turned into one literal quote inside the value.

Can it produce nested JSON objects?

No. The output is always a flat array of objects, one per data row, with one key per header cell. Dotted header names such as user.name stay as literal keys rather than becoming nested structures.

Does my uploaded file get sent to a server?

No. Upload CSV reads the file locally with the browser FileReader and drops the text into the input box, so nothing is transmitted.

What does the Swap button do?

It copies the JSON output text into the CSV input box and re-runs the parser on it. It is not a reverse converter, and JSON pasted into the input will not turn back into CSV.

Is there a file size limit?

No limit is enforced, but conversion re-runs on every keystroke and blocks the page while it works, so a file with tens of thousands of rows will feel sluggish. Split very large exports before pasting them.

Most CSV headaches come down to two questions: which character separates the fields, and what each column really means once the quotes are gone. Set the delimiter, check the record count, and read a few objects before you trust the whole file.

Found this useful? Share it