Text

CSV / JSON Converter

Convert CSV to JSON and JSON to CSV in your browser. Auto-detects the delimiter, handles quoted fields and escaped quotes, previews the parsed table, and downloads the result. Free, no upload, no signup.

By the Samastam teamLast updated

Runs locally — nothing is uploaded

Drag & drop a .csv or .json file, or paste above. Files are read in your browser.

JSON output
A CSV / JSON converter turns tabular comma-separated text into an array of JSON objects, and turns a JSON array back into a clean CSV file. Paste text or drop a file below to convert in either direction — the parsing runs entirely in your browser, so nothing you paste ever leaves your machine.

What this is and why it matters

CSV and JSON are the two formats almost every data-handling task eventually passes through, and they answer different needs. CSV — comma-separated values — is a flat text grid: one row per record, one column per field, separated by a delimiter. It is what spreadsheets export, what most bulk-upload forms accept, and what a data analyst can open in Excel without a second thought. JSON — JavaScript Object Notation — is a nested, typed structure: objects with named keys, arrays, numbers, booleans, and strings. It is what web APIs speak, what configuration files use, and what a program can load without a parsing library.

The friction shows up the moment you need to move data from one world to the other. A backend endpoint hands you a JSON array and a colleague needs it in a spreadsheet. A client sends a CSV export from their CRM and your import script expects an array of objects. A settings file needs a small JSON block that you would rather build from a quick two-column table than hand-type. Each of these is a conversion, and doing it by hand is both slow and error-prone.

The subtle part is that CSV is not as simple as splitting on commas. The format allows a field to be wrapped in double quotes, and inside those quotes a comma is just text, not a column break. A literal double-quote inside a quoted field is escaped by doubling it. A field can even contain a line break. A naive split misreads all of these and silently shifts every column after the offending cell, which is exactly the kind of bug that corrupts a data import without throwing an error. A proper parser — the kind this tool implements — walks the text character by character and tracks whether it is currently inside a quoted field, so the columns stay aligned no matter what the cells contain.

How to use this tool

Pick a direction. The toggle at the top switches between CSV to JSON and JSON to CSV. Choose the one that matches what you are pasting in — the output panel updates to show the converted result in the other format.

Provide your data. You can paste text straight into the input box, or drag and drop a file onto it. A .csv or .txt file is read as CSV; a .json file is read as JSON. The input area uses a monospace font so columns and brackets line up and mistakes are easier to spot. Everything you paste stays in the browser tab; nothing is sent anywhere.

Tune the CSV options. When converting CSV, the tool auto-detects whether your delimiter is a comma, a semicolon, or a tab, and shows its guess. If the guess is wrong — European exports often use semicolons — pick the correct delimiter from the override dropdown. Use the header-row toggle to say whether the first line holds the column names. With it on, those names become the JSON object keys; with it off, the tool assigns generic keys col1, col2, col3 and treats every row as data.

Check the preview and export. A small table shows the first fifty parsed rows so you can confirm the columns split where you expect before trusting the output; if there are more rows, the preview notes how many were hidden. If the input is malformed — unterminated quotes, invalid JSON, ragged rows — a friendly inline message explains what went wrong and where. When the result looks right, use the Copy button to grab it, or Download to save it as a .json or .csv file.

Examples and use cases

Converting a spreadsheet export for an API bulk upload

A developer has a product catalogue maintained by the marketing team in Google Sheets. The API that ingests new products expects a JSON array, one object per product, with keys like sku, title, and price. Exporting the sheet gives a CSV with a header row. Pasting that CSV in with the header-row toggle on produces exactly the array of objects the endpoint wants — each column name becomes a key, each row becomes an object. The developer copies the JSON straight into the request body, skipping a throwaway conversion script that would otherwise have to be written, tested, and thrown away.

Cleaning a messy client CSV before importing it

An analyst receives a contact export from a client whose CRM writes semicolon-delimited files, with addresses wrapped in quotes because they contain commas. Opening it in the wrong tool splits each address across several columns and ruins the import. Here, the auto-detect flags the semicolon delimiter, and the quoted-field parser keeps each full address in a single column. The fifty-row preview confirms the columns are aligned before anything is trusted. The analyst switches the direction back to JSON to CSV once the data is cleaned, and re-exports a well-formed comma-delimited file the import tool accepts on the first try.

Building a JSON config block from a simple two-column table

An engineer needs a JSON lookup of country codes to country names for a small feature flag config. Rather than hand-typing brackets and quotes for two hundred rows, they keep the pairs as a two-column CSV — code, then name — and convert. With the header row naming the keys, the output is a clean array of objects ready to paste into the config file, with the typed structure and escaping handled automatically instead of by careful manual editing.

Frequently asked questions

How does the parser handle commas inside a field?
By wrapping the field in double quotes. In CSV, a field like "Mumbai, Maharashtra" is a single value even though it contains a comma, because the quotes tell the parser to treat everything between them as literal text. This tool walks the input character by character and tracks whether it is currently inside a quoted field, so a comma inside quotes is kept as part of the value and only an unquoted comma (or your chosen delimiter) actually breaks a new column.
What about double-quotes inside a quoted field?
They are escaped by doubling them, which is the RFC 4180 convention. A field written as "She said ""hi""" decodes to the value: She said "hi". The parser recognises the doubled quote as a single literal quote character rather than the end of the field. When converting the other way, JSON to CSV, the tool automatically re-quotes and doubles any values that contain the delimiter, a quote, or a line break, so the CSV it produces round-trips cleanly.
Should I paste real customer or business data into an AI chatbot to convert it?
No. Pasting real customer records, financial rows, or any confidential business data into a general AI chatbot or an upload-based online converter means handing that data to a third-party server, where it may be logged, retained, or used for training depending on the service. That is a genuine privacy and compliance risk. This converter is different: it runs entirely in your browser using local JavaScript. The CSV or JSON you paste is never uploaded, never sent to any server, and never stored — you can even disconnect from the internet after the page loads and it will still work.
My file is too large for an AI chat to handle reliably. Can this tool convert it?
Yes, and this is exactly where a local tool wins. AI chatbots have context-window limits and often truncate, summarise, or silently drop rows from a large file, so a big CSV can come back with missing or altered records that are hard to notice. Because this converter processes the text directly in your browser rather than sending it through a language model, there is no context limit and no summarisation — every row is parsed deterministically. The only practical ceiling is your device memory. For very large files the fifty-row preview is capped for speed, but the full dataset is still converted and available to download.
Why did my columns shift when I opened the CSV somewhere else?
Almost always because the other tool split naively on commas without honouring quoted fields, or because it assumed the wrong delimiter. If a field contained a comma inside quotes, a naive splitter treats that comma as a new column and every column after it slides over by one. Use the delimiter override here to match your file — semicolon and tab are common in exports from European locales and from spreadsheets — and keep the quoted-field parsing on, which this tool does by default.
What happens to the data types when I convert?
CSV has no types — every cell is text. When converting CSV to JSON, values are kept as strings by default so nothing is silently misread (a leading-zero code like 007 stays 007 rather than becoming the number 7). When converting JSON to CSV, nested objects or arrays inside a cell are serialised back to a compact JSON string so no information is lost, and the header row is built from the union of keys found across the objects.
Does the header-row toggle change the output?
Yes. With the header-row toggle on, the first line of the CSV is treated as column names and becomes the keys of each JSON object. With it off, the first line is treated as data and the tool assigns generic keys — col1, col2, col3 and so on — so no row is lost. Turn it off when your CSV has no header line, or when the first row is genuinely data you do not want promoted to keys.

Related tools