PrettifyPrettify

CSV to JSON Converter

Paste a CSV and get a JSON array with one object per row, keyed by the header. Prettify detects comma, semicolon, tab, and pipe delimiters, reads quoted fields correctly, and skips report metadata above the header. The conversion runs in your browser. Copy the JSON or download it.

JSON
The converted result shows here as you paste.
Runs in your browser. Nothing is uploaded.

How CSV rows become JSON objects

The header row supplies the keys. Each later row becomes one object in the array, in file order. Every value is a string, because a CSV cell is plain text. The number 120 becomes "120", 3.5% stays "3.5%", and 0042 keeps its leading zeros.

An empty cell becomes an empty string, not null. A row with fewer fields than the header leaves out the missing keys. A row with more fields keeps the extra values under generated keys such as "Column 4".

Key features

Spreadsheet exports are rarely tidy. Prettify handles the usual problems before it builds the JSON, so you do not have to clean the file by hand first.

  • The delimiter is detected: comma, semicolon, tab, or pipe. A first line of sep=; is honored.
  • A header that sits below a block of metadata lines is found. The metadata is left out, and the panel counts the lines.
  • A quoted field can hold a comma, a doubled quote, or a line break, and it stays one value.
  • A duplicate header is renamed, so a, a becomes a and a_1. An empty header gives an empty key. The panel lists a warning for each.
  • A byte order mark at the start of the file does not end up in the first key.
  • Blank lines between rows are skipped, and both LF and CRLF line endings work.

How to convert CSV to JSON

Start in the box at the top of this page. It reads documents up to 512 KB. When the CSV cannot be read, the panel names the problem, and the button changes to "Fix it in the editor".

  1. Paste your CSV into the box labeled "Paste your CSV", or select "Try an example".
  2. Read the JSON in the result panel. The summary counts rows and columns, for example "3 rows, 4 columns."
  3. Select Copy to put the JSON on the clipboard, or select Download to save it as prettify.json.
  4. Select "Open in full editor". The editor opens at /app/editor with the JSON in the Raw view.
  5. Switch to the Tree or Table view to check the keys and the rows.
  6. For a file above 512 KB, open the CSV in the editor, select Convert in the Transform group of the toolbar, and pick JSON.

Worked example: a report with metadata

The CSV below is a weekly report. Two metadata lines come first, then a blank line, then the real header. The block after it is the JSON that Prettify produces.

The metadata lines are not in the JSON, and the panel warns that 2 metadata lines were left out. The quoted channel "Search, paid" keeps its comma. The empty conversion cell is an empty string.

Every number is a string. The value 0042 keeps its zeros, which a guess at the type would have cut to 42.

Report,Weekly signups
Generated,2026-10-19

Week,Channel,Signups,Conversion
2026-W41,"Search, paid",120,3.5%
2026-W41,Email,48,
2026-W42,Referral,0042,1.2%

[
  {
    "Week": "2026-W41",
    "Channel": "Search, paid",
    "Signups": "120",
    "Conversion": "3.5%"
  },
  {
    "Week": "2026-W41",
    "Channel": "Email",
    "Signups": "48",
    "Conversion": ""
  },
  {
    "Week": "2026-W42",
    "Channel": "Referral",
    "Signups": "0042",
    "Conversion": "1.2%"
  }
]

Common use cases

A CSV is easy to produce and hard to use in code, because a row is only a list of cells. JSON gives each value a name. These are common jobs for this page.

  • Load a spreadsheet export into a web app, a test, or a mock API.
  • Seed a database or a fixture file from a table.
  • Convert a billing, analytics, or bank report that has metadata above the header.
  • Check a file before an import: the row and column counts show a wrong delimiter at once.
  • Open the CSV in the editor to sort and filter the table before you convert. SQL over the CSV is a Pro feature.

Getting numbers instead of strings

Prettify does not guess types. A guess would turn the ID 0042 into 42 and a ZIP code such as 02134 into 2134. Convert the columns you need in your own code, for example with Number(row.Signups).

The same rule means a cell that holds JSON text, such as {"a":1}, stays a string. Parse it in code if you need the object.

Frequently asked questions

Why did my column named 2024 move to the front?

JavaScript lists keys that are whole numbers before all other keys, so a header such as 2024 or 1 comes first in each object. The values are right. Only the order in the JSON differs from the file.

What happens to a CSV with only one column?

It converts to an array of objects with one key. The panel adds a warning that it could not detect a delimiter and used a comma. The result is still correct.

How does Prettify find the header?

It looks for the real header below any metadata block, such as the lines at the top of an AWS, analytics, or bank export. When there is any doubt, line 1 stays the header, as in a plain CSV reader.

Is my CSV uploaded to convert it?

No. Parsing and conversion run in your browser tab, so a bank statement or a billing export stays on your device. Only a share link, which you create on purpose, sends data.

Can I turn the JSON back into CSV?

Yes. Use the JSON to CSV page. The metadata lines do not come back, because they were never in the JSON. The header and the rows do.

Related tools