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.
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.
" 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.
"Smith, John" stays one field instead of splitting into two.
\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.
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 cell | With type inference on | With it off |
|---|---|---|
true | true (boolean) | "true" (string) |
42 | 42 (number) | "42" (string) |
042 | 42 (number, leading zero lost) | "042" (string, preserved) |
| empty cell | null or "", per checkbox | "" |
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.
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.
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.
From the blog
Deep dives on the things these tools touch
Minification, UUID collisions, diffing API responses, and the other questions that come up around this toolset.