inyourbrowser.com

CSV to JSON array of objects

Turn CSV rows into a JSON array of objects, one object per row, with the header row supplying every key. Repeated column names get a numeric suffix so no column is lost, and rows with extra values trigger a warning. All processing runs in your browser.

CSV Input
Output

CONVERT

Comma-separated input. First row is used as object keys. Quoted fields with commas are handled correctly.

Runs entirely in your browser

How it works

The first record becomes the list of keys. A header name that appears twice gets a numeric suffix, so a second name column becomes name_2 and no column is lost. Every later row becomes one object with those keys: a short row fills its missing keys with empty strings, and values past the last header are left out, with a warning above the output. Every value stays a string, because CSV carries no types.

Example

A repeated header gets a suffix, a short row gets empty strings, and the extra value UK is left out with a warning:

name,name,city
Ann,Lee,Oslo,UK
Bob
[
  {
    "name": "Ann",
    "name_2": "Lee",
    "city": "Oslo"
  },
  {
    "name": "Bob",
    "name_2": "",
    "city": ""
  }
]

Processing runs in your browser

All conversion happens inside your browser tab using JavaScript. Our servers are not involved at any point.

Technical specification

CSV quoting follows the conventions in RFC 4180 (IETF, 2005): a field that contains a comma, a double quote, or a line break is wrapped in double quotes, and a double quote inside it is written twice.

Standard
RFC 4180. Common Format and MIME Type for Comma-Separated Values (CSV) Files
Delimiter
Comma only
Output
JSON array of objects, or CSV with LF line endings
Download
converted.json or converted.csv

Related operations

After converting, pretty-print or minify the JSON output. If your data starts as YAML, turn it into JSON first. To drop repeated lines from an export before converting, remove duplicate lines; the first occurrence of each line is kept, so the header row stays on top, and matching ignores letter case, so rows that differ only in case count as duplicates.

Frequently asked questions

How are the object keys chosen?
The first row supplies the keys, in column order. Every later row becomes one object with those keys, so a CSV with a header and 50 data rows gives an array of 50 objects.
What happens to repeated column names?
The second column with the same name gets the suffix _2, the third _3, and so on. A header of name,name,city gives the keys name, name_2, and city, so every value keeps its own key.
What if a row has more or fewer values than the header?
A short row gets empty strings for its missing keys. Values past the last header have no key, so they are left out and a warning above the output says so. Put double quotes around any value that contains a comma.
Where does the conversion run?
The parser runs as JavaScript in your browser tab. Our servers are not involved at any point.

Last reviewed September 30, 2026

Other pages for this tool

Related tools

JSON formatter
Pretty-print, minify, validate, and sort JSON keys. Instant output.
YAML formatter
Format, validate, and convert YAML. Compatible with Kubernetes, CI configs, and OpenAPI files.
XML formatter
Pretty-print, minify, and validate XML. Uses the browser's native DOMParser.
Sort lines
Sort lines alphabetically, by length, or shuffle randomly. Remove duplicates and empty lines in one click.