Skip to content

Runs entirely in your browser. Nothing you paste leaves this page.

Free / No sign-up

CSV to JSON converter (and back).

Convert CSV to JSON or JSON to CSV as you type. Quoted fields, embedded commas and line breaks follow RFC 4180, the delimiter is detected for you, and a table preview shows exactly how rows split.

Direction

Output JSON

Output view
[
  {
    "order_id": 1001,
    "customer": "Smith, Ada",
    "city": "London",
    "total": 249.9,
    "paid": true,
    "notes": null
  },
  {
    "order_id": 1002,
    "customer": "Ravi Kumar",
    "city": "Dehradun",
    "total": 1200,
    "paid": false,
    "notes": "Asked for \"express\" delivery"
  },
  {
    "order_id": 1003,
    "customer": "Zoë Martin",
    "city": "Auckland",
    "total": 89.5,
    "paid": true,
    "notes": "Gift wrap,\nnote on line two"
  },
  {
    "order_id": 1004,
    "customer": "Omar Haddad",
    "city": "Dubai",
    "total": 0.99,
    "paid": true,
    "notes": null
  },
  {
    "order_id": 1005,
    "customer": "Jane Doe",
    "city": "02134 Boston",
    "total": 310,
    "paid": false,
    "notes": "Repeat customer"
  }
]

5 rows × 6 columns, comma-separated (auto-detected).

How to use it.

  1. 01

    Paste CSV (or a JSON array) or load the sample. It converts as you type.

  2. 02

    Leave the delimiter on Auto-detect or pick one, and toggle the header row and type inference.

  3. 03

    Switch the output to Table to check how rows split, then copy the JSON or CSV.

What it does.

Everything this tool handles, all of it inside your browser tab.

  • CSV to JSON and JSON to CSV, converted as you type
  • RFC 4180 quoting: delimiters, doubled quotes and line breaks inside fields
  • Delimiter auto-detection for comma, semicolon, tab and pipe
  • Header row on or off (objects or arrays)
  • Cautious type inference that keeps leading zeros and big IDs exact
  • Table preview with ragged-row and missing-cell warnings
  • Unclosed quotes located by line and column
  • Swap sends the output back as the new input
  • Runs entirely in your browser: no upload, no sign-up

Worked examples.

  • Commas and quotes inside a field

    id,name,comment
    7,"Doe, Jane","She said ""ship it"""
    
    > [
      {
        "id": 7,
        "name": "Doe, Jane",
        "comment": "She said \"ship it\""
      }
    ]

    The quoted comma stays inside the name, and the doubled quotes become one quote (escaped as \" in JSON).

  • Semicolon CSV from a European spreadsheet

    product;price;stock
    Keyboard;49,90;12
    Mouse;19,50;0
    
    > Auto-detected: semicolon
    [
      { "product": "Keyboard", "price": "49,90", "stock": 12 },
      { "product": "Mouse", "price": "19,50", "stock": 0 }
    ]

    The semicolon is detected automatically. Decimal commas stay strings rather than being guessed into numbers.

  • Leading zeros and big IDs are kept

    zip,user_id,score,active
    02134,9007199254740993,4.5,true
    
    > [
      {
        "zip": "02134",
        "user_id": "9007199254740993",
        "score": 4.5,
        "active": true
      }
    ]

    Type inference turns 4.5 and true into a number and a boolean, but keeps the ZIP code and the oversized ID as exact strings.

  • JSON with different shapes to CSV

    [{"id":1,"name":"Ada","tags":["admin","dev"]},{"id":2,"name":"Lin","team":{"name":"Ops"}}]
    
    > id,name,tags,team
    1,Ada,"[""admin"",""dev""]",
    2,Lin,,"{""name"":""Ops""}"

    Columns are the union of keys. Nested values are written as JSON text, and the quotes inside them are doubled.

  • An unclosed quote

    id,note
    1,"unfinished
    2,ok
    
    > Unclosed quote: this quoted field never ends at line 2, column 3.

    Without the closing quote, everything after it, including the next line, belongs to the same field. Add the quote after unfinished.

How the converter works

A parser written for this page follows RFC 4180, the closest thing CSV has to a standard. It reads quoted fields that contain the delimiter, doubled quotes and line breaks, accepts both CRLF and LF line endings and ignores a leading byte-order mark from Excel exports. Everything runs in your browser tab, so exports of customer or order data never leave your machine.

With a header row, each line becomes a JSON object keyed by the column names. Without one, each line becomes an array. Blank header cells are named column_1, column_2 and so on, and repeated names get a suffix (email, email_2) so no column silently overwrites another.

The RFC 4180 rules in plain English

Fields are separated by a delimiter and records by line breaks. A field that contains the delimiter, a double quote or a line break must be wrapped in double quotes, and a double quote inside it is written twice: "She said ""ship it""". Spaces are part of the field, so a, b gives the second field a leading space.

The RFC specifies commas, but real files vary. Spreadsheet apps in regions that use a decimal comma (much of Europe and Latin America) export semicolon-separated files, databases and logs often use tabs (TSV), and some systems use pipes. Auto-detect counts each candidate outside quotes across the first lines and picks the one that is most frequent and most consistent. Some exports add a sep=; first line for Excel; delete it before converting, because it is not part of the data.

Type inference: numbers, codes and booleans

CSV has no types; every field is text. With Infer types on, plain integers and decimals become JSON numbers, true and false become booleans, and empty fields become null. Turn it off to keep every value as a string.

Inference is deliberately cautious. Values with leading zeros, such as ZIP codes, phone numbers or product codes (02134), stay strings so the zero is not lost. Integers above 9,007,199,254,740,991 stay strings because JavaScript numbers cannot hold them exactly, which matters for database IDs. Decimal commas (49,90) and dates are left as text; convert them in code where you know the locale and format.

When in doubt, turn inference off and convert types in code, where the rules can be tested. A column of numbers with the odd N/A entry is a typical case that needs a human decision rather than a guess.

JSON to CSV

The input should be an array of objects, an array of arrays or a single object. Columns are the union of all keys in the order they first appear, so objects with different shapes still line up, and missing values become empty cells. Nested objects and arrays are written as JSON text inside the cell. Pick the output delimiter to suit the destination: semicolons for spreadsheets in decimal-comma locales, tabs when values are full of commas.

Fields are quoted only when needed, quotes are doubled and records end with CRLF as RFC 4180 specifies. To import the result into Excel with accented characters intact, use Data, From Text/CSV, and choose UTF-8, since double-clicking a CSV may assume a legacy encoding.

Common CSV problems and fixes

Ragged rows (a row with more or fewer fields than the header) usually mean an unquoted delimiter inside a value, such as an address with a comma. The status line names the first ragged row, and the table marks missing cells. An unclosed quote is reported at the line and column where the field starts.

Curly quotes pasted from a word processor are not CSV quotes; replace them with straight double quotes. When you export CSV that other people will open in a spreadsheet, be aware of formula injection: a cell starting with =, +, - or @ may be executed as a formula, so prefix such values with an apostrophe or validate them on export. Building repeatable imports like this is part of our data engineering work.

CSV in data pipelines

CSV is still the common language between systems: spreadsheet exports, bank statements, CRM and e-commerce reports and bulk uploads to SaaS tools all speak it, while APIs and document databases expect JSON. Converting between the two is everyday ETL work, and most problems come from the same four places: encoding, delimiters, quoting and types.

For a one-off file, this tool is enough. For a recurring import, write the rules down: expected columns, delimiter, encoding (UTF-8), how empty values and dates are written, and what happens to rows that fail validation. Then load files with a real CSV library, such as Python's csv module or a streaming parser in Node.js, rather than splitting lines on commas, which breaks the first time a value contains a comma or a line break.

Very large files belong in a pipeline rather than a browser tab. Columnar formats such as Parquet suit analytics storage better, and a data pipeline can convert CSV on arrival so analysts never handle the raw file.

Private by design

Nothing is uploaded: parsing, conversion and the table preview all happen in JavaScript in this tab. The preview renders the first 500 rows to stay fast, while the JSON or CSV output always includes every row. Files of several megabytes convert in well under a second on a modern laptop.

If a conversion looks wrong, open the Table view first: it shows exactly how each row was split, which makes delimiter and quoting problems obvious. Fix the source or override the delimiter rather than editing the JSON by hand.

Questions, answered

Something else on your mind? Ask a consultant and get a reply within one business day.

Is my CSV uploaded?

No. Parsing and conversion happen in JavaScript in this tab, so customer lists and exports stay on your machine.

How does delimiter auto-detection work?

It counts commas, semicolons, tabs and pipes outside quotes on the first lines and picks the one that appears most often and most consistently per line. You can override it at any time.

Why is my ZIP code still a string?

Values with a leading zero stay strings so the zero is not lost. Numbers are only inferred for plain integers and decimals without leading zeros.

Can fields contain line breaks?

Yes, if the field is wrapped in double quotes, as RFC 4180 allows. The table preview shows the break inside the cell.

How do I write a quote inside a CSV field?

Double it and wrap the field in quotes: "She said ""hi""". The converter does this for you in JSON to CSV.

What JSON shapes can be converted to CSV?

An array of objects, an array of arrays or a single object. Nested objects and arrays are written as JSON text inside a cell.

Does it convert TSV?

Yes. Tab-separated input is detected automatically, and you can pick Tab as the output delimiter for JSON to CSV.

Why are some cells marked missing?

That row has fewer fields than the first row. It usually means an unquoted delimiter in an earlier field or a truncated export.

Why do accented characters look wrong in Excel?

Excel may open a CSV with a legacy encoding. Import it with Data, From Text/CSV and choose UTF-8 (65001).

More free tools.

All tools

Need tooling like this inside your product?

We build internal tools, developer platforms and APIs. Tell us what your team keeps doing by hand.