Skip to content
FastTool

JSON Formatter & Validator

Paste or open JSON to format it, minify it or find the exact line and column of an error. Turn API records or JSON Lines into a CSV table you can open in Excel. Runs in your browser. Nothing is uploaded.

Your JSON

Paste or open JSON

Up to 2 MB

One JSON document. To make JSON Lines, start with an array: each item becomes one line.

No file selected 0 B of 2 MB

Create table CSV makes one row per object, up to 10,000 records and 100 columns. Nested values stay in one cell. How the CSV is built

Runs in your browser. Nothing is uploaded.

No result yet

Choose an action and the result appears here, ready to copy or download.

How to use it

  1. Paste JSON into the box, or choose Open a JSON or JSONL file.
  2. Choose Format JSON to indent it, Minify JSON to remove spaces, or Validate only to check it.
  3. If there is an error, read the line and column, then choose Go to line to jump to it.
  4. Copy or download the result. Formatted JSON also comes with a path CSV that lists every value.
  5. To open records in a spreadsheet, choose Create table CSV.

Worked examples

Find a trailing comma

Choose Example with an error, then Validate only. The input is:

{
  "order": "A-1042",
  "tags": ["gift", "fragile",]
}

The result says Invalid JSON: "Array items cannot end with a trailing comma." at line 3, column 30 (byte 52). Delete the comma after "fragile" and it validates.

Turn API records into spreadsheet rows

Paste [{"id":"00123","name":"Ada"},{"id":"00007","active":false}] and choose Create table CSV. You get 2 records and 3 columns:

"id","name","active"
"00123","Ada",""
"00007","","false"

A field that appears only in a later record still gets its own column, and no record is skipped. Both IDs keep their leading zeros because they are strings.

JSON Lines to an array, and back

Choose JSON Lines / NDJSON, open a .jsonl file and choose Convert to JSON array. The lines {"id":"001"} and {"id":"002"} become [{"id":"001"},{"id":"002"}].

To go the other way, choose JSON (one document), paste an array such as [{"ok":true},null,42] and choose Create JSON Lines. You get 3 lines and a final newline.

How it works

The tool reads your text with a strict parser that follows RFC 8259, the JSON standard, before the browser's own JSON reader sees it. That is how it can point to the exact line, column and byte of a mistake.

It also stops when converting would quietly change your data: two keys with the same name in one object, whole numbers above 9,007,199,254,740,991, or numbers with more digits than JavaScript can store. Put such values in quotes to keep them as text.

Formatting rebuilds the JSON with 2 spaces, 4 spaces or tabs. The path CSV has one row per value with its JSON Pointer path, such as /items/0/sku. The table CSV has one row per object and one column for every key, in the order the keys first appear. Nested objects and arrays stay as compact JSON in one cell.

The table CSV uses UTF-8 with a byte-order mark, quoted fields and Windows line endings, so Excel shows accented letters correctly. Cells that start with =, +, - or @ and aren't numbers get an apostrophe in front, so a spreadsheet can't run them as formulas. CSV has no data types, so import ID and date columns as Text. Missing fields and empty strings both become empty cells.

Questions

Why is a trailing comma an error?

JSON doesn't allow a comma after the last item in an object or array, even though JavaScript does. Remove the comma before the closing } or ].

Can JSON have comments or single quotes?

No. Comments such as // note and single-quoted strings are not part of JSON. Keys and strings need double quotes, so remove comments before you paste.

Why won't it format my big numbers?

JavaScript keeps whole numbers exact only up to 9,007,199,254,740,991. A 20-digit ID would be rounded without warning, so the tool stops instead. Put long IDs in quotes, like "12345678901234567890".

What's the difference between JSON and JSON Lines?

A JSON file holds one value, often a big array. JSON Lines, also called NDJSON, puts one complete value on each line. Logs and data exports use it because programs can read one line at a time.

Why does a cell in my CSV start with an apostrophe?

Cells that start with =, +, - or @ and aren't numbers get an apostrophe in front, so a spreadsheet can't run them as formulas. Numbers such as -12.5 and a lone dash stay as they are, and your JSON is not changed.

Is my JSON uploaded?

No. Everything runs in your browser, and nothing is kept after you close the page.

Limits

Up to 2 MB of text, 128 levels of nesting and 100,000 values. JSON Lines can have up to 10,000 lines. A table CSV can have up to 10,000 records, 100 columns and 32,767 characters per cell. Each download can be up to 8 MB, and the path CSV up to 50,000 rows.

The tool checks JSON syntax, not a JSON Schema, and it never guesses a fix for you. Working with spreadsheet rows instead? The CSV Cleaner & CSV to Excel removes duplicates and keeps IDs as text in Excel.

Sources