OnSumo Tools

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 this tool works

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.

Worked example

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