HomeToolsConversionCSV to JSON Converter

CSV to JSON Converter

Parse CSV format and convert it into structured JSON arrays or objects.

Conversion

CSV to JSON

CSV Input
JSON Output

Turning rows into useful records

CSV is compact, portable, and deliberately flexible. A spreadsheet export, database result, analytics report, and vendor feed may all be called CSV even when one uses commas, another uses semicolons, and a third is really tab-separated values. JSON is more explicit: arrays have boundaries, object properties have names, strings are quoted, and numbers, booleans, and null can retain types. This CSV to JSON converter bridges those representations in the browser.

Use it when you need to convert CSV to JSON online for an API fixture, import script, test dataset, or quick inspection. Paste text into the CSV pane and the JSON preview updates when the delimiter, header setting, type parsing, or output shape changes. The result can be copied or downloaded as converted.json.

Choose the shape before converting

The most consequential choice is Array of Objects versus Array of Arrays. Objects are convenient when downstream code addresses values by name. With First row is header enabled, this input:

ticket,owner,urgent,hours
INC-204,"Nguyen, Mai",true,1.5
INC-219,Patel,false,3

becomes records resembling:

[
  { "ticket": "INC-204", "owner": "Nguyen, Mai", "urgent": true, "hours": 1.5 },
  { "ticket": "INC-219", "owner": "Patel", "urgent": false, "hours": 3 }
]

Array output preserves positional data. If headers are enabled, the header remains the first nested array; it is not discarded. This form can be smaller and suits code that already knows index 0 is ticket and index 3 is hours. Without headers, object output creates column_1, column_2, and so on, while array output contains only row values. Choose according to the consuming contract, not appearance.

Delimiters, quoting, and line endings

Select comma, semicolon, tab, or pipe to match the source. Look for the character separating fields on several rows. Semicolon-delimited exports are common where a comma is used as a decimal mark. Text copied from spreadsheet cells generally needs Tab, while log-like feeds may use |.

Quoted fields are handled character by character. Delimiters and line breaks inside double quotes remain part of that field, and two consecutive quotes inside a quoted field become one literal quote. Thus "She said ""ready""" yields She said "ready". Both LF and CRLF record endings work. Empty trailing lines are ignored, but an empty field inside a real row is retained.

Quoting does not automatically trim strings. If the source contains Alice, its spaces remain unless smart parsing recognizes another type. Clean unwanted whitespace at the source or after conversion rather than assuming normalization.

What smart type parsing changes

With Parse numbers & booleans on, each field is trimmed for type detection. Case-insensitive true and false become JSON booleans, and null becomes JSON null. Any value JavaScript’s Number() accepts becomes a JSON number. Everything else remains the original string.

That convenience requires judgment. Product code 00127 becomes 127; scientific notation 1e3 becomes 1000; and large integers may exceed JavaScript’s safe precision. Account numbers are labels, not quantities. Turn parsing off for postal codes, SKUs, phone extensions, fixed-width IDs, or numbers whose exact spelling matters. With parsing disabled, every cell, including true, remains a JSON string.

Dates are not inferred. 2026-08-17 stays text, avoiding timezone guesses. Likewise, a comma-decimal value such as 12,50 must be quoted under comma separation or used with a semicolon delimiter; it is not converted automatically to 12.5.

A practical data-import workflow

Suppose operations sends a semicolon-separated incident export. Inspect several rows in a plain-text editor, especially descriptions that may contain semicolons or newlines. Select Semicolon, keep headers enabled, and initially disable type parsing. Confirm one JSON record appears per incident and that property names match the columns. Then enable parsing and inspect identifiers, timestamps, flags, and measurements. If an incident ID loses leading zeros, disable parsing and cast only known numeric fields in application code.

Copy the result for a temporary request payload, or download it for a fixture. Before use, validate required columns and row counts in the destination. Conversion establishes syntax and shape; it cannot know that closed_at is required only when status is closed or that a customer ID must exist in another table.

For an API mock, object output is usually easiest:

const response = await fetch('/fixtures/incidents.json');
const incidents = await response.json();
const open = incidents.filter((item) => item.status === 'open');

For matrix calculations or chart libraries, arrays may avoid remapping. Preserve a schema documenting column order if headers will later be removed.

Header and row irregularities

Headers are used literally as object keys. An empty header receives a generated name such as column_3. Duplicate non-empty headers are dangerous: the later cell overwrites the earlier property in each record. Rename duplicate columns first. Spaces and punctuation are legal in JSON property names, but application code is often simpler with stable names such as created_at instead of Created At.

If a data row has fewer fields than the header, missing positions become empty strings in object mode. Extra fields beyond the header count disappear from object output because no key exists for them. Array mode retains each row’s actual length, making it useful for diagnosing ragged input. Compare field counts before trusting a large conversion.

An unclosed quote causes subsequent newlines and delimiters to be treated as field content. The parser is permissive and may still produce JSON rather than a formal syntax error. If the record count is unexpectedly small or one value spans many lines, check quote balance.

Boundaries of the format

CSV represents a flat table. A cell containing a,b,c does not become a JSON array, and a header like user.name does not build a nested user object. Those changes need domain rules after conversion. The tool does not upload files, detect character encodings, infer delimiters, stream huge datasets, or validate a schema. Paste text the browser has already decoded. Convert Windows-1252, Shift_JIS, or other legacy files to Unicode first if they display incorrectly.

Browser memory sets a practical limit. A modest report is ideal; multi-gigabyte exports belong in a streaming CLI or ETL pipeline. Object output is typically larger than CSV because every property name repeats for every row.

Character encoding deserves a separate check before conversion. A byte-order mark at the start of decoded text can become part of the first header, creating a property that looks like id but does not compare equal to it. If the first key behaves strangely, remove the BOM in a text editor and repeat the conversion. Also check that spreadsheet software did not replace straight quotes with typographic quotes, because only the standard double-quote character controls CSV field quoting.

Use array mode as a structural diagnostic

When object output looks plausible but records are missing values, temporarily choose Array of Arrays. That view exposes each parsed row before header names hide irregular widths or duplicate keys overwrite cells. Keep First row is header enabled if you want the header retained as row zero, then compare every nested array length. A short row indicates omitted trailing or middle fields; a long row often indicates an unquoted delimiter. Once row boundaries are correct, return to object mode and inspect header uniqueness. This control-driven check is faster and more reliable than debugging the final JSON properties alone.

Troubleshooting a surprising result

If one property contains the entire row, the selected delimiter is wrong. If a name with a comma becomes two properties, quote the source field. If line breaks appear in one value, inspect quote balance. When 0005 becomes 5, disable type parsing. When output has no data records except headers, remember that object mode consumes the first row as metadata. When keys are column_1, headers were disabled or cells were blank. For malformed records, switch temporarily to arrays so missing and extra positions are visible.

Questions developers ask

Can I convert TSV to JSON?

Yes. Choose Tab and paste real tab-separated text. The object, array, header, and type options work the same way.

Are commas inside a value supported?

Yes, when the field is enclosed in double quotes. Embedded double quotes must be doubled according to common CSV convention.

Does this create nested JSON?

No. It creates flat objects or arrays. Build nested structures afterward according to the destination schema.

Why did a long numeric ID change?

Smart parsing converts numeric-looking text to JavaScript numbers, which removes leading zeros and can lose precision. Disable it for identifiers.

Is the download valid JSON?

The result comes from JSON.stringify, so it is syntactically valid JSON. Expected columns and business constraints still require separate validation.

Does conversion upload the CSV?

The component parses input and creates the download locally in the browser. Clipboard and device policies still apply, so follow organizational rules for sensitive data.

Learn More

Read our comprehensive guide to master this utility.

Read Guide →