CSV (comma-separated values) stores a table as plain text: one record per line, with its fields separated by a delimiter. This tool converts both ways: CSV to an array of JSON objects keyed by the header row, and JSON back to a CSV table.
How CSV really works
The CSV standard, RFC 4180, wraps a field in double quotes when it contains the delimiter, a quote or a line break, and writes a quote inside such a field as two quotes. That is why splitting each line on commas breaks real files. The second line below has two fields, but splitting it on commas gives three pieces:
name,quote
"Smith, Ada","She said ""hi"""The tool reads it character by character with a small state machine and gives:
[
{
"name": "Smith, Ada",
"quote": "She said \"hi\""
}
]It accepts LF, CRLF and CR line endings, a missing final line break and a UTF-8 byte order mark. Rows with too few or too many fields are reported with their line numbers, never hidden.
Numbers, leading zeros and long IDs
By default a value becomes a JSON number only when its text is exactly how that number is written: “36” and “98.5” become numbers, while “007”, “1e3”, “1.10”, “+5” and “12345678901234567890” stay text. So leading zeros in codes survive, and long IDs keep every digit. true and false become booleans and empty fields null. Other options keep everything as text or convert every number; the summary lists the columns that changed type.
Formula injection
When a CSV file opens in a spreadsheet program, a cell starting with =, +, - or @ can run as a formula, so a cell written by someone else could pull in outside data. With “Protect against spreadsheet formulas” on (the default), such cells, and cells starting with a tab or a carriage return, get a ' in front and open as text. That changes the cell's text; plain numbers such as “-5” are left alone, and JSON output is never changed.
Limits and privacy
Files can be up to 5 MB. Inputs under 200,000 characters convert as you type; larger ones convert in a background worker you can cancel. The preview table shows the first 50 rows; Copy and Download always use the whole output. Your data never leaves your browser. Like the rest of the site, the page records a visit when it loads, but not your data.
How to use
- Choose CSV to JSON or JSON to CSV, then paste your data, load a file or load the sample.
- Check the delimiter, header and value options against the preview table.
- Copy the output or download it as a .json or .csv file; Swap sends it back the other way.
Features
- A hand-written RFC 4180 parser: quotes, doubled quotes and line breaks inside fields.
- Delimiter detection for comma, semicolon, tab and pipe, with a manual choice.
Common uses
- Test data from spreadsheets. Turn a sheet of test cases into JSON fixtures.
- API responses to a spreadsheet. Flatten a JSON response into CSV to read or share it.
- Comparing exports. Convert two exports to the same format, then compare them with the Diff Checker.
Frequently asked questions
How do I convert CSV to JSON?
Choose CSV to JSON, paste the CSV or load the file, then copy or download the result. With a header row, each row becomes an object keyed by the column names.
How do I convert JSON to CSV?
Choose JSON to CSV and paste an array of objects, an array of arrays or one object. Columns follow the order in which keys first appear.
Why do my numbers keep their leading zeros?
Because “007” isn't how the number “7” is written, the default rule keeps it as text, which keeps codes and IDs intact. Choose Convert all numbers to turn such values into numbers anyway.
What delimiters does it support?
Comma, semicolon, tab and pipe. Auto-detect tries each on the first rows and picks the one that gives the most fields in every row; you can choose one yourself.
How are quotes and commas inside fields handled?
As RFC 4180 says: a field with the delimiter, a quote or a line break is wrapped in double quotes, and a quote inside it is doubled, both when reading and when writing CSV.
What is a formula injection?
A CSV cell that a spreadsheet runs as a formula because it starts with = or a similar character; see “Formula injection” above.
Is my file uploaded?
No. It is read and converted in your browser and never sent anywhere or saved. The page itself records a visit when it loads, as every page here does.
How large a file can it handle?
Up to 5 MB, about 100,000 rows of a typical table, converted in a background worker.
Need to test a whole website, not just a snippet?
RoboQA tests real pages and user journeys in a browser: logins, forms, clicks and full flows. See what RoboQA can test or compare plans.