OnSumoTools

CSV to JSON Converter

This tool converts CSV data into JSON arrays directly in your browser. Paste or drag a CSV file, and the tool maps each row to a JSON object using your header row as keys. No data is uploaded to a server. Your spreadsheet contents, customer lists, database exports, and internal records stay on your device. The tool is free, requires no account, and works offline after the page loads.

Ready3 rows, 4 columns (delimiter: ,)

Preview (first 10 rows)

idnameactivescore
1Alicetrue42
2Bobfalse
3Smith, Johntrue88

CSV and JSON conversion runs in your browser. Files are read locally and are not uploaded to a server.

How does the CSV to JSON Converter work step by step?

The CSV-JSON converter bidirectionally transforms CSV and JSON data. CSV-to-JSON: the tool reads the first row as column headers and converts each subsequent row into a JSON object using those headers as keys. Type inference is applied by default: values that look like integers (digits only, no leading zeros) become JSON numbers; the strings 'true' and 'false' (case-insensitive) become JSON booleans; empty cells become null; everything else remains a string. Type inference can be disabled to keep all values as strings. JSON-to-CSV: a JSON array of objects is flattened; all unique keys found across any object in the array become column headers, and missing keys for a given row produce empty cells. Key assumption: CSV-to-JSON assumes the first row is a header row. Toggle no-header mode to auto-generate numbered column names (col1, col2, etc.) for headerless CSVs. Edge case: CSV fields containing the delimiter character (comma by default) must be double-quoted in the source file. If the source uses a non-standard delimiter (semicolon, tab, pipe), select the correct delimiter before parsing; an incorrect delimiter setting causes the parser to treat entire rows as single fields. For tab-separated values (.tsv files), use the tab delimiter option.

What does a typical CSV to JSON Converter result look like?

You export a spreadsheet as semicolon-separated CSV from Excel EU settings. Paste it here, leave delimiter on auto, enable type inference, and copy the JSON array for your API tests.

Frequently asked questions

  • Is my CSV data sent to a server?

    No. The entire conversion runs in your browser using JavaScript. There is no upload, no network request, and no server-side processing. You can verify this by opening your browser's DevTools Network tab while using the tool. This is why you can safely paste customer data, financial records, or any file containing PII.

  • Does it handle CSV files with thousands of rows?

    Yes. The parser processes row by row in memory and can handle files with tens of thousands of rows in modern browsers. Files under 10 MB convert in under a second. For very large files (50 MB or more), you may see a brief pause while the browser processes the data. If you routinely work with files that large, a command-line tool like csvtojson or jq will be faster.

  • Can it handle semicolon-delimited or tab-delimited files?

    Yes. The tool auto-detects the delimiter by scanning the first five rows. If the detection is wrong, you can manually select comma, semicolon, tab, or pipe from the delimiter dropdown. Tab-separated values (TSV) from Excel and Google Sheets exports work without any manual adjustment in most cases.

  • Does it preserve the order of columns?

    Yes. JSON objects in the output maintain the same key order as the columns in your CSV. While the JSON specification does not guarantee key order, the tool produces output in insertion order, and all modern JavaScript engines preserve this order.

  • What encoding does it support?

    The tool reads input as UTF-8 by default, which covers most modern CSV exports. If your file uses a different encoding (like ISO-8859-1 or Windows-1252), convert it to UTF-8 first using your text editor's \\\\\\\"Save As\\\\\\\" encoding option or a command-line tool like iconv.

  • What is NDJSON and when should I use it?

    NDJSON (Newline-Delimited JSON) outputs one JSON object per line with no wrapping array. It is the standard input format for streaming data pipelines, log ingestion systems (like Elasticsearch Bulk API), and tools like jq. Use NDJSON when your downstream system processes records one at a time rather than loading an entire array into memory.

Related tools

Two formats, two jobs

CSV is flat and simple. Rows and columns, easy to open in a spreadsheet. JSON is nested and structured, and it's what most web APIs speak. Moving data between them is a daily chore for developers and analysts.

This converter goes both ways. Paste CSV and get JSON. Paste JSON and get CSV. It runs in your browser, so the data never leaves your device.

How the CSV side works

The first row is treated as headers, and each later row becomes an object with those headers as keys. The tool detects the delimiter on its own, so comma, semicolon and tab files all load without setup. If it guesses wrong, you can set it yourself.

Type inference turns numbers into real numbers and true or false into booleans, instead of leaving every value as text. That saves you a cleanup step. If you'd rather keep everything as strings, for ZIP codes with leading zeros say, switch inference off.

A 10-row preview shows the output before you copy or download it, so you can catch a bad header or a broken quote early.

How the JSON side works

Give it an array of objects and it builds a header row from the keys, then one line per object. Flat data converts cleanly. Deeply nested data doesn't fit a table, so flatten it first or expect the nested parts to come through as text.

NDJSON, in plain words

NDJSON puts one JSON object per line instead of wrapping everything in one big array. It's popular for logs and for loading large datasets, because a program can read it line by line without parsing the whole file at once. Pick it when the system receiving your data asks for it.

Common gotchas

Fields with commas inside them need quotes. A good CSV already has them, but hand-edited files often don't.

Encoding matters. UTF-8 is the safe choice. If accented letters turn into odd symbols, the source file probably used another encoding.

Column order in the JSON output follows the CSV header order.