Home / Developer Tools / CSV โ‡„ JSON Converter

CSV โ‡„ JSON Converter

Convert between CSV and JSON.

CSV โ‡„ JSON Converter at a glance

CSV โ‡„ JSON Converter is a free online developer tool you can use right now to convert between CSV and JSON โ€” no account, no install and no usage limit. It runs entirely inside your browser, so whatever you enter stays on your own device.

Price
Free โ€” no trial, no paid tier, no watermark
Sign-up
Not required
Where it runs
In your browser โ€” nothing is uploaded to a server
Works on
Chrome, Safari, Firefox and Edge โ€” desktop, tablet and phone
Category
Developer Tools

About CSV โ‡„ JSON Converter

Convert a CSV export into a JSON array of objects, or flatten JSON back into CSV rows. The first CSV row is treated as the header and becomes the object keys.

CSV looks trivially simple and is not, because the delimiter can appear inside the data. A field containing a comma must be wrapped in double quotes, and a field containing a double quote escapes it by doubling it. This is why naively splitting a CSV line on commas breaks the moment a real address or a product description arrives โ€” the classic bug in hand-rolled CSV parsing.

Line endings are the other recurring problem. CSV files exported on Windows end lines with a carriage return and line feed, while Unix tools use a line feed alone. A parser that only handles one leaves a stray carriage return on the end of every final field, producing values that look correct and never match a comparison. Excel also frequently writes a UTF-8 byte order mark at the start of the file, which turns the first column's header into something with an invisible prefix.

Converting the other way, remember that JSON is hierarchical and CSV is flat. Nested objects and arrays have no natural CSV representation, so they must be flattened into dotted column names or serialised into a single cell. Any conversion of deeply nested JSON to CSV involves a decision about which of those to do.

How to use CSV โ‡„ JSON Converter

  1. Paste your CSV or JSON into the input box.
  2. Choose the direction you want to convert.
  3. Copy the converted result โ€” CSV headers become JSON keys and vice versa.

Frequently asked questions

How are commas inside a field handled?

A field containing a comma must be wrapped in double quotes, and the parser respects that. A double quote inside a quoted field is escaped by doubling it. This is why splitting a CSV line on commas is unreliable โ€” quoted fields have to be parsed properly.

Why do my values have a stray character at the end?

Almost certainly a carriage return from a Windows-style line ending, or a UTF-8 byte order mark that Excel wrote at the start of the file. Both are invisible and both break exact comparisons.

What happens to nested JSON when converting to CSV?

CSV is flat and has no way to express nesting, so nested objects must either be flattened into dotted column names or serialised into a single cell. Deeply nested structures do not round-trip cleanly.

Is the first row treated as a header?

Yes. Converting CSV to JSON uses the first row as the object keys. Going the other way, the object keys become the header row.

More Developer Tools