🔁

CSV to JSON

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Development Tools

Spreadsheets export CSV by default and modern applications consume JSON by default, and the space between those two facts is where this converter lives. Paste comma-separated text from any export — a CRM dump, a sales report, a survey result — and get a clean JSON array where each row becomes an object and the header row becomes the keys. The whole conversion runs in your browser, so spreadsheets with customer names, salaries, or internal figures stay on your machine.

The hard part of CSV conversion is never the happy path; it is the quoted field. Real exports are full of them: addresses like "1600 Amphitheatre Pkwy, Suite 1" that contain a comma inside quotes, free-text comments containing line breaks inside quotes, and values with embedded double quotes escaped by doubling them (""). Naive converters split on every comma and every newline, shredding such rows into garbage. This one implements the full CSV quoting rules, the same ones Excel and Google Sheets follow when writing files.

The Conversion Rules

Each input row maps to one JSON object. By default the first row is treated as a header and its cells become the keys for every subsequent row. Take this three-line roster:

  • name,dept,start_year
  • Ada Lopez,Engineering,2019
  • Sam Okafor,Support,2022

The output is a two-element array: the first object has name: "Ada Lopez", dept: "Engineering", start_year: "2019" — or the number 2019 if numeric conversion is on — and the second follows the same shape. Rows with fewer cells than the header leave the missing keys empty; rows with extra cells keep the surplus under indexed keys rather than silently dropping data.

If your data has no header — raw log lines, for instance — toggle the header option off and the converter generates positional keys like column_1, column_2, so every value is still reachable and labeled.

How to Use It (Step by Step)

  1. Paste your CSV text into the input area, or drop in the contents of a .csv file opened in any text editor.
  2. Leave the first-row-as-header setting on for normal spreadsheet exports; switch it off for headerless data.
  3. Check the output: the JSON array renders with one object per row, keys matching your header names exactly, including spaces and unusual characters.
  4. Use copy to grab the result for pasting into code or an API tester, or download to save a .json file.
  5. If anything looks wrong, look at the raw CSV first — ragged rows and encoding issues in the source show up honestly in the output.

Quoted Fields: Where Cheap Converters Fail

The quoting rules are worth spelling out because they decide whether your data survives. A field wrapped in double quotes may contain commas, line breaks, and doubled quotes without confusing the parser. A worked example shows why this matters:

  • id,note,city
  • 7,"Shipped late, customer notified","Washington, DC"

A naive splitter produces five cells from that second row and two broken objects. The correct parse — which this tool applies — produces exactly three fields: id as 7, note as Shipped late, customer notified, and city as Washington, DC, commas intact inside their quoted homes. The same protection covers multi-line values: a quoted comment spanning three physical lines is one field, and the row count in your output matches the logical record count, not the line count of the text.

CSV input cellCorrect parseNaive split yields
"Smith, John"One cell: Smith, JohnTwo cells, both wrong
"said ""stop"""said "stop"Four garbage fragments
"line1 line2"Two-line single cellTwo phantom records

One caveat that trips people exporting from Excel: numbers formatted for display — currency symbols, thousands separators like 1,234, percent signs — arrive in the CSV as display text and convert as strings. Export raw values, or clean them after conversion, if you need real numbers downstream.

Spreadsheet Export: The Typical Workflow

The most common route here starts in Excel or Google Sheets: File, then Download or Save As, then CSV. The export flattens your sheet to text, and this converter lifts it back into structured JSON for whatever needs it — a product catalog for an e-commerce import, user lists for a marketing tool that only accepts JSON, seed data for a database migration, or fixtures for tests. The pattern is identical each time: header row becomes keys, each data row becomes an object, and the array order preserves your sheet's row order, so sorting in the spreadsheet carries through to the JSON.

Merge workflows benefit too. When two teams keep overlapping spreadsheets, converting both to JSON makes them diffable and scriptable — compare arrays, match objects on an id key, and merge programmatically instead of copying rows between files by hand. And because conversion is local, there is no reason to hesitate over confidential rosters, payroll sheets, or customer records.

CSV vs JSON: What Each Side Gives You

CSV is flat by nature: one table, one record type, no nesting. JSON nests freely, which means converting gives you objects that could hold structured sub-values even though the CSV source could not express them. Two honest limitations to plan around. First, everything from CSV is text at heart; with numeric conversion off, 2022 stays a string, and string comparisons like "10" < "9" will misbehave if you forget. Second, a CSV has exactly one header, so one conversion produces one flat record type — a spreadsheet with multiple logical tables on one sheet should be split before converting, or the JSON will mix apples and oranges under shared keys.

Tips and Best Practices

  • Clean the header row before converting: unique, short, lowercase column names become pleasant JSON keys; duplicated headers silently overwrite each other.
  • Verify the row count in the output matches your expectation — quoted multi-line fields make the text's line count meaningless, so count records, not lines.
  • Empty cells become empty values, which is faithful to the source; decide downstream whether those mean null, zero, or missing.
  • Keep dates in ISO format in the spreadsheet before export so the JSON works with date libraries without re-parsing.
  • For one-off merges, convert both files here and compare in any JSON-aware tool rather than stitching spreadsheets manually.

Frequently Asked Questions

How do I convert a CSV file to JSON?
Open the CSV in any text editor, copy its contents, and paste them into the converter. With the first-row-as-header option on, the header cells become the JSON keys and every data row becomes one object in the output array. Copy the result or download it as a .json file. The conversion runs entirely in your browser, so there is no upload step, no size gate beyond your device's memory, and no signup — a 10,000-row export converts locally in a moment.
How are commas inside values handled during conversion?
Correctly, per the standard CSV quoting rules. A field wrapped in double quotes can contain commas, line breaks, and escaped quotes without splitting the record — an address like "1600 Amphitheatre Pkwy, Suite 1" stays one field. Doubled quotes inside a quoted field, written as "", decode back to a single quote character. This matters because naive converters that split on every comma shred such rows into misaligned fragments, so if another tool ever produced garbled objects from your export, missing quote handling was almost certainly the cause.
What if my CSV has no header row?
Switch off the first-row-as-header option. The converter then assigns positional keys such as column_1, column_2, and column_3 to each cell, so every value in the output objects is labeled and reachable even without meaningful names. This suits raw log lines, sensor dumps, and other headerless exports. If you know what the columns represent, a quick find-and-replace on the generated keys afterward gives you the same readable result a header row would have provided.
Why are my numbers strings after converting CSV to JSON?
CSV is plain text, so everything arrives as characters; the converter's default behavior preserves them as strings, including values like 2019 or 19.99. If numeric conversion is enabled, cells that parse cleanly as numbers are converted, while text cells stay strings. Watch for display formatting from Excel: currency symbols, thousands separators like 1,234, and percent signs prevent clean parsing and keep values as strings. For downstream sorting or arithmetic, convert types explicitly — comparing number-like strings alphabetically yields wrong orders such as 10 before 9.
Does the converter preserve the order of my rows?
Yes. The output array mirrors your input rows in order, first record to last, and the keys inside each object follow the header's column order. That means any sorting you did in the spreadsheet carries through to the JSON, which matters for exports where order is meaningful — ranked lists, chronological logs, or playlists. Row order preservation also makes the converter usable for diffing two versions of the same export: identical inputs produce identical arrays, so comparing them reveals exactly what changed between files.
Is it safe to convert a spreadsheet with personal data here?
Yes. The entire conversion — parsing, quote handling, JSON generation — runs as JavaScript in your browser tab, and the text never leaves your device. No upload occurs, nothing is stored server-side, and you can confirm in the network tools that no requests fire during conversion. Employee rosters, customer lists, and payroll extracts are therefore fine to paste. Free, no account required, and it works on mobile. As always with sensitive data, close the tab when finished rather than leaving the pasted content sitting in an open session.

Related Tools