Utilumo
LightDarkSystem
Guide1 min readUpdated June 25, 2026

How to convert CSV to JSON

Short answer

To convert CSV to JSON, use the first row as the keys and each following row as one object. Each cell becomes a value on its row's object, and the result is an array of those objects.

The basic mapping

CSV (comma-separated values) is a flat table: the first row holds the column names, and every other row is a record. JSON represents the same data as an array of objects, where each object's keys are the column names.

name,role,active
Ada,author,true
Grace,engineer,true
CSV input
[
  { "name": "Ada", "role": "author", "active": "true" },
  { "name": "Grace", "role": "engineer", "active": "true" }
]
JSON output
Try it: CSV to JSONPaste CSV and get formatted JSON objects, with the header row used as keys.Open tool

Quotes, commas, and newlines

A cell can legitimately contain a comma, a quote, or a line break if it is wrapped in double quotes, per the CSV convention in RFC 4180. A naive split on commas breaks on this, which is why a real parser is safer than a one-line script.

Everything starts as textCSV has no types, so true and 42 arrive as strings. If you need real booleans or numbers, convert them after parsing.

Common mistakes

  • Splitting on commas without handling quoted fields.
  • Duplicate or empty header names, which collide as JSON keys.
  • Assuming numbers and booleans are typed; they are text until you convert them.

References

Questions

What happens to duplicate column headers?

Duplicate keys cannot coexist in a JSON object, so a good converter normalizes them, for example by renaming the second occurrence. Clean your header row first when possible.

Are CSV values converted to numbers automatically?

Not by default. CSV is untyped, so values arrive as strings. Convert them to numbers or booleans in your code if you need real types.

Does this send my data anywhere?

No. Utilumo's developer tools parse and transform input inside the browser tab. Nothing is uploaded, stored, or logged.

Keep reading