Convert CSV Without Losing Identifiers
Inspect CSV headers and automatic type detection before converting rows into JSON objects.
Use the interactive tool ↓Inspect the first row before converting
This utility uses the first CSV row as property names. It trims whitespace around those header names and converts each later row into an object. The delimiter must match the input: comma, semicolon, tab and pipe are supported options.
CSV to JSON
Protect identifiers from automatic typing
Try this small input:
code,active
00123,trueWith automatic type detection enabled, the numeric-looking code can become the number 123, losing its leading zeros, and true becomes a boolean. Disable automatic typing when the values are identifiers: both fields then remain strings, including 00123.
Large digit strings can also lose precision if converted to JavaScript numbers. Quoting a CSV field controls CSV syntax; it does not necessarily prevent this converter’s later type detection. Use the typing option deliberately.
Set up a reliable conversion
- Make the header names nonempty and unique.
- Select the delimiter used by the file or exporter.
- Decide whether automatic number, boolean and null conversion is appropriate.
- Convert and inspect the first, middle and last output records.
- Download the JSON only after comparing representative values.
Quoted fields can contain delimiters and line breaks, and doubled quotes represent a quote within a field. That support does not make the parser a strict CSV validator. Repair malformed or unclosed quoting in the source rather than relying on a plausible-looking output.
Check missing, repeated and extra columns
A row with fewer cells than headers receives empty values for missing cells. Extra cells beyond the headers are not turned into additional named properties. Repeated headers overwrite the same property, so rename duplicates before conversion. Avoid special object-property names such as __proto__ when creating a normal record schema.
The converter does not infer a database schema or guarantee a lossless round trip. Empty strings, the literal text null and an absent field are different concepts; automatic typing and missing-cell handling can change those distinctions.
Troubleshoot a one-column result
A mismatched delimiter often explains why an entire line becomes one value. Check the source’s export settings and reselect the delimiter. Use JSON Formatter to inspect the resulting syntax and JSON to CSV for a separate reverse conversion after checking the schema and types.