ToolGenie.org Logo

CSV to JSON Converter

Paste CSV or load a .csv file and get clean JSON back. Quoted fields, odd delimiters and Excel exports are all handled in your browser.

Files stay on your device. Maximum size 5 MB.

How to Use the CSV to JSON Converter

  1. Paste your CSV into the input box, or use the file picker to load a .csv export from Excel, Google Sheets or a database dump (up to 5 MB).
  2. Pick the delimiter your file actually uses — comma, semicolon, tab or pipe — or leave it on Auto-detect and let the parser work it out from the first few lines.
  3. Keep "First row is the header" switched on to get an array of objects keyed by your column names, or switch it off to get a plain array of arrays.
  4. Leave "Convert numbers and booleans" on so 42 becomes a number and true becomes a boolean, or turn it off when every field must stay a string.
  5. Choose 2-space, 4-space or minified output, click "Convert to JSON", then copy the result straight into your editor.

What Is a CSV to JSON Converter?

A CSV to JSON converter reads comma-separated values — the export format that every spreadsheet, database client and analytics dashboard can produce — and rewrites them as JSON, the shape that APIs, JavaScript apps and document databases actually want. Each data row becomes one object keyed by the header line, so a 500-row export turns into a JSON array you can drop into a seed script, a test fixture or a mocked API response without touching it by hand.

Most throwaway conversions break on the very first quoted field. This tool runs a complete RFC 4180 parser rather than splitting on commas: a quoted value may contain the delimiter itself, an escaped double quote written as "", or a line break in the middle of a cell, and all three survive intact. It also strips the UTF-8 byte order mark that Excel writes at the front of its exports, reads Windows CRLF and Unix LF line endings equally well, and can detect on its own whether a file is separated by commas, semicolons, tabs or pipes — the usual headache with European locale exports where the comma is already the decimal separator.

Need the opposite direction? The JSON to CSV converter turns JSON arrays back into spreadsheet rows. Once your JSON exists, the JSON formatter will pretty-print or minify it, and the query params to JSON tool solves the other everyday parsing chore — turning a URL query string into a readable object.

Frequently Asked Questions (FAQ)

How do I convert CSV to JSON online for free?

Paste your CSV into the box above or load a .csv file, choose the delimiter, then click "Convert to JSON". The conversion runs in your browser, so there is no upload, no account and no limit on how often you use it.

Does this CSV to JSON converter handle commas inside quoted fields?

Yes. The parser follows RFC 4180, so "Lovelace, Ada" stays one field instead of splitting in two. Escaped double quotes written as "" and line breaks inside a quoted cell are handled the same way.

Can I convert a CSV file instead of pasting the text?

Yes. Use the file picker to load any .csv file up to 5 MB and its contents appear in the input box ready to convert. The file is read locally with the browser FileReader API and never sent anywhere.

How do I convert CSV to a JSON array without a header row?

Switch off "First row is the header". Every line, including the first, is then emitted as an array of values, which gives you a JSON array of arrays instead of an array of objects.

Why are my numbers coming out as strings in the JSON?

Type conversion is probably switched off. With "Convert numbers and booleans" enabled, 42 becomes a number, true and false become booleans, and an empty field becomes null. With it off, every value stays a quoted string.

Which delimiter should I pick for a European Excel export?

Excel in most European locales writes semicolon-separated files because the comma is already the decimal separator. Choose Semicolon, or use Auto-detect, which compares comma, semicolon, tab and pipe and keeps whichever gives a consistent column count.

What happens if some rows have more columns than the header?

Those rows are still converted and you get a warning showing how many were ragged. Extra values are keyed as column_5, column_6 and so on, while short rows simply omit the missing keys.

Is my CSV data uploaded to a server?

No. Parsing, type conversion and JSON generation all happen in your browser with JavaScript. ToolGenie never receives the contents of your spreadsheet, which makes the tool safe for customer exports and internal reports.

Tips for Converting CSV to JSON

  • Tip 1: When you are not sure how a file is separated, start with Auto-detect — the detected delimiter is printed above the output so you can confirm it before trusting the result.
  • Tip 2: Turn type conversion off for ZIP codes, phone numbers and order IDs. Leading zeros are preserved as strings, and very long numeric IDs never lose precision.
  • Tip 3: Pick minified output when the JSON is going into a fixture file, a curl request body or an environment variable, and 2-space output when a human has to read it.
  • Tip 4: Keep the round trip in mind: the JSON ↔ CSV converter takes your JSON back to a spreadsheet, and the query params to JSON converter handles URL query strings when your data arrives that way instead.