CSV to JSON
Convert CSV to a JSON array of objects using the header row as keys. Detects comma, semicolon or tab delimiters and handles quoted fields. Runs in your browser.
About CSV to JSON
The CSV to JSON converter reads a table exported from a spreadsheet or database and turns each row into a JSON object, using the header row as the keys. The output is an array indented with 2 spaces, ready to use as test data, a fixture, a seed file or the body of an API request.
The delimiter is detected from the header line, so comma, semicolon and tab-separated files work without settings. Quoted fields can contain delimiters, line breaks and escaped double quotes, and a byte order mark from Excel exports is removed. Malformed files are reported clearly rather than producing misaligned objects.
How to use CSV to JSON
- Paste CSV into the input box, or open or drop a .csv file.
- Make sure CSV → JSON is selected; it is the default on this page.
- Fix any reported problem, such as a row with the wrong number of fields.
- Copy the JSON array or download it as a .json file.
Features
- Detects comma, semicolon or tab delimiters from the first line.
- Supports quoted fields with embedded delimiters, line breaks and doubled quotes ("").
- Removes a UTF-8 byte order mark and accepts both Windows (CRLF) and Unix line endings.
- Skips blank lines and names empty header cells column1, column2 and so on.
- Keeps every value as a string, so postal codes and IDs with leading zeros are not altered.
Common uses
- Turning a spreadsheet export into fixtures or seed data for an application.
- Converting a CSV report into JSON for a script, API request or document database import.
- Checking that a CSV file is well formed before importing it elsewhere.
- Building mock data for a front-end prototype from a shared spreadsheet.
Tips
- Every value comes out as a string. If you need numbers or booleans, convert them in your code after parsing, where you know which columns should be numeric.
Frequently asked questions
Does the first row have to be a header?
Yes. The first row supplies the keys for every object. If your file has no header, add a line of column names before converting; otherwise the first data row is used as keys and disappears from the results.
Why are numbers converted as strings?
CSV has no data types, so the converter keeps every value exactly as written. That avoids damaging values such as 007, phone numbers starting with + or long account IDs. Convert specific columns to numbers in your own code where you know the intended type.
What causes “Every CSV row must have the same number of fields as the header”?
A row has more or fewer fields than the header. Common causes are an unquoted value that contains the delimiter, a missing trailing column, or a line of notes at the end of the export. Quote values containing the delimiter and remove extra lines.
Are semicolon-separated files from Excel supported?
Yes. In many European locales Excel saves CSV with semicolons. The converter counts commas, semicolons and tabs outside quotes on the header line and uses whichever appears most often as the delimiter.
Can column headers be repeated?
No. Each header becomes a JSON key, so duplicate column names would overwrite each other. The converter reports “CSV headers must be unique” instead; rename the duplicate columns and convert again.
Can I convert CSV to JSON online for free without signing up?
Yes. Use this tool without an account or payment. Files are processed in your browser. Download the result after processing; supported formats and browser requirements are described above. Conversion can change quality, transparency or layout depending on the formats.
Is my input uploaded?
Tools run in your browser. Files, text and results are not uploaded to our servers and are cleared when you leave the tool.
Your privacy comes first
Tools run in your browser. Files, text and results are not uploaded to our servers and are cleared when you leave the tool.