Skip to content

JSON Tools

Format, minify, repair and validate JSON with exact error positions, browse it as a tree, and convert between JSON, CSV and YAML.

Runs in your browser. Nothing is uploaded.

Formatting runs in your browser. The input is never uploaded or put in the URL. Ctrl+Enter formats. You can also drop a file here or open one; it is read in the browser.

About this tool

JSON Tools parses your input with the browser's strict JSON parser (RFC 8259), pretty-prints or minifies it and shows the exact line and column of the first syntax error. Repair mode fixes the syntax a JavaScript file gets away with - comments, trailing commas, single or typographic quotes, bare keys, NaN and undefined - and lists every change it made. The result can be browsed as a collapsible tree with copyable paths. It also converts CSV to JSON. Nothing is uploaded.

Every mode runs entirely in your browser: the JSON or CSV you paste is parsed, formatted, sorted, repaired or converted by the page itself, is never sent to the XGM API and is never written into the URL, so a link you share carries the tool and the mode only. A file you open or drop in the format mode is read by the browser itself (FileReader) and stays on your machine. The CSV parser and the CSV writer follow RFC 4180, so quoted fields may contain commas, quotes and line breaks. Nothing is stored: reloading the page clears the input. The only request this page makes by itself is the page-view event sent after you accept analytics, which records the path and the tool name and never your input.

Repair changes syntax, never data. It removes comments and trailing commas, requotes single-quoted and typographic-quoted strings, quotes bare object keys and turns NaN, Infinity and undefined into null, and it lists every one of those edits with its line and column. The characters inside a string are copied through untouched, so a comma or a // that happens to sit in a string is left alone. Anything it cannot fix is reported with a position and a reason instead of being guessed at, and in that case nothing is changed at all.

Size guidance: documents up to about 5.00 MB are formatted in well under a second on a current laptop. Larger ones still work, but the page slows down because the whole result is rendered in the tab, and the file picker refuses anything above 25.00 MB. The tree shows at most 500 rows and 200 children per branch at a time, so a long response cannot stall the tab.

How to use it

  1. Paste JSON into the input or load the example.
  2. Choose the indent and whether keys should be sorted.
  3. Press Format (or Ctrl+Enter) to pretty-print, or Minify to remove whitespace.
  4. If the document does not parse, press Repair: it fixes the syntax it recognises and lists every change with its line and column.
  5. Fix any remaining error at the reported line and column, then browse the tree, copy a path, or export the result.

FAQ

Is my JSON sent to a server?

No. Parsing and formatting run in your browser and the input is not put in the page URL.

Why is my JSON invalid when JavaScript accepts it?

JSON is stricter than JavaScript: keys and strings need double quotes, and comments, trailing commas, single quotes, NaN and undefined are not allowed.

What does Repair change, and can it corrupt my data?

It changes syntax only: it removes comments and trailing commas, requotes single-quoted and typographic-quoted strings, quotes bare object keys, and turns NaN, Infinity and undefined into null. Everything between a string's quotes is copied through untouched, so a comma or a // inside a string is left alone. Every edit is listed with its line, column, the old text and the new text. Anything it cannot fix is reported with a position and a reason, and in that case nothing is changed at all.

What does Sort keys do?

It orders object keys alphabetically at every level, which makes two JSON documents easier to compare. Array order is never changed.

How large can the input be?

Several megabytes work in modern browsers. Very large documents can make the page slow because the whole result is rendered.

Why did my long ID number change after formatting?

The formatter parses with JSON.parse, which turns every number into an IEEE 754 double, so an integer above 9,007,199,254,740,991 (2^53 - 1) is already rounded before anything is printed. RFC 8259 section 6 warns about exactly this: implementations agree on numbers only within double precision. Carry Twitter-style snowflake IDs, 64-bit database keys and similar values as strings if they have to survive a round trip.

Read the full JSON Tools guide