CSV to JSON

Convert CSV files to JSON arrays with automatic delimiter detection

Shortcuts: Ctrl+Enter run · Ctrl+L clear · Ctrl+D download

About CSV to JSON

This tool converts CSV files and pasted CSV text into JSON arrays. It automatically detects the delimiter (comma, semicolon, tab, or pipe), uses the first row as keys, and produces clean JSON you can use directly in your code or import into a database. Ideal for transforming spreadsheet exports into API-ready data.

  • ✓Auto-detects comma, semicolon, tab, and pipe delimiters
  • ✓Uses first row as JSON object keys automatically
  • ✓Handles quoted fields containing commas, line breaks, and escaped "" quotes
  • ✓Produces a JSON array of objects ready to use in any application

Converting CSV Correctly: Quotes, Delimiters and Types

CSV looks trivial — values separated by commas, one record per line — but real exports are full of edge cases. A city like "London, UK" contains the delimiter. A comment field might contain a line break or a quote. European spreadsheets often use semicolons because the comma is their decimal separator. A converter that simply splits on commas and newlines will silently produce shifted columns and broken records.

Rules this converter follows

  • ·The first row is the header; each header becomes a key, with surrounding spaces trimmed
  • ·The delimiter (comma, semicolon, tab or pipe) is detected from the header row
  • ·Fields wrapped in double quotes may contain the delimiter and line breaks
  • ·A doubled quote inside a quoted field ("") becomes one literal quote character
  • ·Blank lines are skipped, and missing trailing values become empty strings

Example

name,quote,city
Ada,"She said ""hi""","London, UK"
Bob,"line one
line two",Paris
[
  { "name": "Ada", "quote": "She said \"hi\"", "city": "London, UK" },
  { "name": "Bob", "quote": "line one\nline two", "city": "Paris" }
]

Notice that Bob's quote spans two physical lines in the CSV but stays a single record, and the doubled quotes in Ada's row come through as real quote characters. These are the cases most often broken by quick split-based scripts.

Every value is a string

CSV has no types: 42, true and 2026-01-01 are all just text in the file. This tool keeps every value as a string rather than guessing, because guessing breaks real data — ZIP codes such as 02134 lose their leading zero, long IDs lose precision when turned into numbers, and a product code like 1E5 would become 100000. Convert types in your own code, where you know which columns should be numbers or dates.

Before you convert

  • ·Make sure every header is present and unique — duplicate headers overwrite each other in the resulting objects
  • ·Save spreadsheet exports as UTF-8 so accented characters survive
  • ·Check the row count in the success message against the number of records you expect

Tip: Going the other way? The JSON to CSV tool flattens nested objects into columns and quotes fields that need it.

Frequently Asked Questions

Ad