CSV to JSON Converter
Turn a CSV table into JSON without guessing which cells are numbers, booleans or null. Paste text or choose a local UTF-8 file, select objects or arrays, then copy or download the checked result.
Convert a table without guessing data types
- Choose Pasted CSV or Local file. Files must use UTF-8 and a .csv, .tsv or .txt suffix, up to 5 MiB. Select the separator explicitly: comma is the default, with semicolon, tab and pipe available. A TSV filename does not automatically choose tab.
- Choose Objects to use the first record as exact header names, or Arrays to keep every record as data. Objects need unique, nonblank headers and matching row widths. Arrays keep variable row widths. Use example fills an identifier/name/active table and waits for Convert.
- Select Convert and read the data-record count, width information and actual UTF-8 output size. Conversion details connects the parsed fields to the chosen JSON representation. Copy JSON and Download JSON use the full result even when the preview is incomplete. Clear removes both sources and restores defaults.
Understand strings, headers and exact fields
Every cell stays a string, including 00042, 9007199254740993, true, false, null, empty fields and formula-looking text. There is no numeric precision conversion, null substitution, formula evaluation or nested structure inferred from a heading.
A separator inside double quotes stays within one field. Two doubled quotes become one quote, and embedded CRLF, LF or CR stays in the parsed string. Spaces are data. A stray quote, unclosed quote or text after a closing quote is rejected rather than repaired. A final record ending does not create a phantom row; further blank records are retained.
Object headers keep their exact spelling and whitespace, except that a name consisting only of trim whitespace is rejected. Exactly repeated names are rejected, but A and a or composed and decomposed accented names remain distinct. Names such as __proto__, constructor and 2 are ordinary flat keys. Emitted members follow column order; JSON receivers may enumerate object names differently.
Output uses two-space indentation, LF formatting and one final LF, encoded as UTF-8 without an added BOM. One leading UTF-8 file signature, or one leading pasted U+FEFF under this tool's policy, is consumed; additional U+FEFF remains content. UTF-16/32 signatures and malformed UTF-8 are not guessed or repaired. JSON escapes preserve embedded control characters rather than deleting them.
Examples of the two representations
The supplied three-record example has headers id, name and active, followed by two data records. Objects produces two objects and 150 UTF-8 bytes, keeping 00042 and the long identifier as strings. The quoted comma in A, B does not add a fourth column, and true remains the string true.
Arrays applied to the same example produces three arrays and 146 UTF-8 bytes. The first array contains id, name and active as values instead of using them as keys. A short row or a blank record is retained at its actual width in this mode.
A valid header-only input produces an empty JSON array with a final LF: three bytes and no data objects. That is a successful, exportable result, unlike an empty or signature-only source with no CSV records. A blank data record under a single-column header becomes an empty string; under a wider header it is a width error.
Input, output and preview bounds
Files are limited to 5242880 bytes. Decoded or pasted text must fit 5000000 UTF-16 units, 50000 physical CRLF/LF/CR sequences including quoted content, 50000 logical records including a header, 256 columns per record and 2000000 parsed cells. CRLF counts as one physical ending. These are explicit resource limits, not visible-character counts.
The complete formatted JSON must fit 16777216 UTF-8 bytes. A worker operation exceeding 15000 milliseconds is terminated without a partial download. Repeated long headers and escaped controls can make an otherwise admitted CSV exceed the output limit. Limits do not guarantee memory use or speed on every device.
The default JSON preview shows at most 100000 Unicode scalar characters and clearly marks an incomplete preview. Full current Copy and download retain every accepted field. Clipboard denial exposes the full current readonly text for manual copying, not merely the prefix. Method field previews can also be shortened without changing export.
This version has no URL input, separator auto-detection, type inference, comments, directive removal, CSV repair or legacy-encoding conversion. RFC 4180 describes a common CSV format, not every producer's dialect. Malformed UTF-16 is rejected, and browser or clipboard normalization that happened before pasting cannot be reversed.
Local conversion and current output
This tool adds no document upload, account, saved history, logging or data-bearing share URL. Editing, switching sources or options, choosing a replacement, cancelling or clearing retires the old result. Existing site services remain separate; local processing is not their certification or a secure-erasure guarantee.
Questions about CSV to JSON
Sources and format references
- rfc-editor.orgRFC 4180RFC 4180 describes one common CSV format; this tool specifies its own parsing rules.
- rfc-editor.orgRFC 8259RFC 8259 describes JSON strings and interoperability considerations for object member names.
- tc39.esECMAScript JSON.stringifyECMAScript specifies JSON string escaping.
- tc39.esECMAScript OrdinaryOwnPropertyKeysECMAScript describes object property ordering; downstream enumeration may differ from emitted CSV column order.
- encoding.spec.whatwg.orgEncoding StandardThe Encoding Standard describes fatal UTF-8 decoding and signatures.
Related tools
JSON to CSV Converter
Convert flat JSON records to delimited text with first-seen columns, original number spellings and explicit empty-value rules.
Open tool — JSON to CSV ConverterCSV Delimiter Converter
Convert CSV separators, preview real columns and spot import problems. Works locally with CSV, TSV and text; values remain unchanged.
Open tool — CSV Delimiter ConverterCompare Two CSV Files
Match rows by a key column and find added, removed and changed records.
Open tool — Compare Two CSV FilesCSV Duplicate Finder & Remover
Find exact duplicate CSV rows or repeated IDs. Review conflicting values, keep original data and download retained, removed and unresolved records.
Open tool — CSV Duplicate Finder & RemoverCSV Merger
Combine rows from several CSV files by exact column name. Preview alignment and download CSV with a merge report.
Open tool — CSV MergerCSV Splitter
Split a CSV by rows or exact file size. Keep headers and download each part.
Open tool — CSV Splitter