CSV to JSON Converter Online Free

💻 Developer Tools ✔ Free Forever

CSV to JSON Converter Online Free

Paste any CSV and get structured JSON instantly. Handles custom delimiters, type inference, header mapping, and both array and object output modes. No data sent anywhere.

✔ Type inference ✔ Custom delimiter ✔ Array or object output ✔ Upload .csv files ✔ 100% browser based
Output mode
Delimiter
Input CSV
Error
Output JSON
Choose a sample
About This Tool

How this CSV to JSON converter parses quoted fields and infers types

Splitting a CSV row on commas works right up until a field itself contains a comma, wrapped safely in quotes, or a quoted field spans multiple lines. A naive split(',') approach breaks on both. This tool runs a real character-by-character state machine instead, tracking whether it is currently inside a quoted field, which is the only way to handle embedded commas, escaped double quotes, and multi-line cells correctly.

Parsing, type inference, and JSON serialization all happen locally in the browser. The file reading uses FileReader.readAsText for uploads and drag-and-drop; nothing is sent to a server at any point.

The character-by-character parser

The parser walks the input string one character at a time with a single boolean flag, inQuotes, tracking state. Everything else follows from that one flag.

Step 1 Detect quote boundaries A " character outside quotes opens a quoted field; one found while inside quotes closes it, unless it’s immediately followed by a second ", which is the standard escape sequence for a literal quote inside a quoted value.
Step 2 Respect the delimiter only outside quotes The chosen delimiter (comma, tab, semicolon, pipe, or a custom string) only ends a field when the parser is not inside quotes, which is exactly why "Smith, John" stays one field instead of splitting into two.
Step 3 Handle both line ending styles Both \r\n and bare \n end a row when outside quotes; the parser checks for and consumes a following \n after a \r so Windows-style line endings don’t produce a phantom empty row.
Step 4 Flush the final row If the input doesn’t end with a trailing newline, whatever’s left in the current field and row buffers still gets pushed, so the last line of data is never silently dropped.
// simplified from parseCSV() in the tool source if (inQuotes) { if (ch === ‘”‘) { if (str[i + 1] === ‘”‘) { curField += ‘”‘; i += 2; continue; } inQuotes = false; i++; continue; } curField += ch; i++; continue; } if (ch === ‘”‘) { inQuotes = true; i++; continue; }

Type inference on each cell

CSV has no native types, every cell is text. When the type inference option is on, each trimmed value gets tested in order: exact match against true/false becomes a boolean, exact match against null becomes JSON null, and anything that survives !isNaN(Number(value)) becomes a JSON number. Everything else stays a string. Empty cells become either an empty string or explicit null, depending on a separate checkbox.

CSV cellWith type inference onWith it off
truetrue (boolean)"true" (string)
4242 (number)"42" (string)
04242 (number, leading zero lost)"042" (string, preserved)
empty cellnull or "", per checkbox""
Leading zeros disappear under type inference. A ZIP code like 02138 or an ID like 007 becomes the number 2138 or 7 once inference is enabled, because Number() has no concept of significant leading zeros. If your data includes codes that must keep their exact digit count, turn type inference off for that conversion, or intentionally quote such values as text before pasting them in.

Three output shapes

Array of objects

The default and most common shape: each row becomes one object keyed by the header row’s column names, producing a JSON array ready for most APIs and data pipelines.

Array of arrays

A raw matrix with no keys attached, one inner array per row, useful when you want positional data rather than named fields, or when column names aren’t meaningful.

Keyed object

Uses the first column’s value as the outer object’s key and the remaining columns as that entry’s fields, turning a row-per-record CSV into a lookup table indexed by ID or name.

State-machine CSV parser RFC 4180 quoting rules Configurable delimiter

Parsers and format specifications

  • RFC 4180 is the closest thing to a formal CSV specification, defining the double-quote escaping rule this parser implements.
  • PapaParse is the widely used JavaScript CSV parsing library with streaming and worker-thread support for very large files.
  • RFC 8259 defines the JSON output format this tool produces.

Typical conversion jobs

Converting an exported spreadsheet into a JSON fixture for an API test suite, turning a data analyst’s CSV export into the array of objects shape a frontend chart library expects, transforming a European locale CSV using semicolons into standard JSON without hand editing the delimiter, and reshaping row based CSV data into a keyed lookup object for fast client side searching.

Common Questions

FAQ: CSV to JSON Converter Online Free

Yes. Completely free, no account needed, and no usage limits.

No. All parsing and conversion happens in your browser. Your data never leaves your device.

Three modes: Array of objects gives one JSON object per row with header keys. Array of arrays produces a 2D array without keys. Keyed by first column creates a map where the first column value becomes the top-level key.

When enabled, the tool inspects each cell value and converts it to the most appropriate JSON type. Numbers, booleans, and null values are detected automatically. Disable it if you need all values to remain as strings.

Yes. Select Semicolon in the Delimiter options. You can also choose tab, pipe, or enter any custom separator character.

Yes. Click Upload .csv to browse your device, or drag and drop a .csv file directly onto the input area. The file is read locally without any upload.

Yes. The parser is fully RFC 4180 compliant. Quoted fields containing commas, newlines, or escaped double quotes are handled correctly.

Privacy Overview

Cookies let this site remember your preferences and show us which tools people actually use. Full detail sits in our Privacy Policy.