CSV to JSON
CSV to JSON turns a table into a JSON array, using the first row as field names. It detects the separator, handles quoted cells and runs free in your browser.
Paste CSV to convert.
What is the CSV to JSON?
CSV to JSON is a converter that turns a CSV table into structured data for code and applications. It reads the first row as field names and maps each following row to a JSON object inside an array. Developers use this format for API payloads, analysts use it to move spreadsheet exports into scripts, and testers use it to prepare fixtures. CSV cells do not carry reliable type information, so check how values appear before using the result. Start with a small sample and confirm the headers, record count and important identifiers before converting a larger table.
Who it is for: CSV to JSON is for developers, data analysts, QA engineers, students and people moving spreadsheet exports into applications.
How to use the CSV to JSON
- Tap Try with sample data to see the expected CSV layout.
- Replace the sample with your CSV text, keeping field names in the first row.
- Convert the table and check that each record has the expected keys and values.
- Copy the JSON into your script, test fixture or destination application.
Why use it
- Records ready for codeTurn table rows into objects that JavaScript and other JSON-compatible tools can read.
- Keep data localConversion runs in your browser, so your CSV does not need to be uploaded for processing.
- Clear field namesUse your header row to give each value a meaningful key in the output.
- Free for repeat tasksConvert small exports and test tables for free, with no subscriptions.
At a glance
- What you put in
- CSV with comma, semicolon, tab or pipe separators, with or without a header row
- What you get
- JSON array of row objects
- Limits
- Flat tables; large inputs depend on available browser memory
- Privacy
- Runs in your browser. Nothing you enter is uploaded or stored.
- Price
- Free for everyone. No subscriptions, no payments, no watermark.
- Works offline
- Yes, once the page has loaded
- Last checked
- by AK Shine
Worked example
name,city,reference Amina,Lagos,00127 Ravi,Pune,00408
[
{
"name": "Amina",
"city": "Lagos",
"reference": "00127"
},
{
"name": "Ravi",
"city": "Pune",
"reference": "00408"
}
]Two data rows become two objects; reference codes stay quoted so their leading zeros remain intact.
When to use something else
- For very large files, repeated jobs or streaming conversion, use a CSV parsing library or command-line workflow rather than relying on browser memory.
- For nested objects, schema validation or relationships between tables, use a script or data transformation tool with explicit mapping rules.
- If your destination requires JSON Lines, convert the array into one object per line with a suitable script or JSONL tool.
Questions people ask
How do I convert a CSV file to JSON online?
Open the CSV as text and paste its contents into the input, including the header row. Convert it, then check the resulting objects before copying them into your application.
Does the first CSV row become the JSON keys?
Yes, when First row is the header is on. Turn it off and each row becomes an array of values instead.
Can I convert CSV to JSON without uploading my data?
Yes. This tool processes the CSV in your browser rather than sending it to a conversion server. Once the tool has been opened and is available offline, it can also work without a connection.
Why are numbers in CSV sometimes converted to strings?
CSV has no types, so converters must guess. This tool turns plain numbers and true or false into JSON values, but keeps codes with leading zeros, like 00127, as text. Turn the option off to keep everything as text.
How should CSV handle commas and quotes inside a cell?
Put a field containing a comma inside double quotes, such as "Lagos, Nigeria". Represent a double quote inside a quoted field with two double quotes; splitting text at every comma is not a reliable CSV parser.
Can I convert an Excel spreadsheet directly to JSON?
Export the sheet as CSV first, then paste the CSV text into this tool. A CSV export represents one table and does not retain workbook formulas, formatting or multiple sheets.
Can I use tab-separated or semicolon-separated data?
Yes. The tool detects commas, semicolons, tabs and pipes, or you can choose the separator yourself under Separator.
What if my CSV has duplicate headers or uneven rows?
Give every column a unique header and make each row contain the same number of fields before converting. Duplicate keys can lose information, while missing or extra fields can make the column mapping ambiguous.