piapia123
en

JSON Formatter & Validator

Format

Everything runs locally in your browser — nothing is uploaded

Convert
Input
Output

Paste JSON on the left — a collapsible tree shows up here

Path
Select a row to copy its path, edit, delete or move it

Expand minified JSON into a collapsible tree on the right: click a triangle to fold or unfold a node, and keys and values are colour-coded by type so the shape of the document is visible at a glance. The editor on the left has line numbers and the same highlighting, so the line and column in a syntax error are easy to find. Search keys and values, copy any node’s path or value, change a value in place, delete a node you do not need, reorder array elements, or convert the whole document to Unicode escapes, an escaped string, a Python dict or a GET query string. Paste something that is a Python dict literal (single quotes, True, None) and it is recognised and turned into JSON automatically. When the syntax is broken you get the exact line and column plus a caret under the offending character.

Features

  • Tree view: fold and unfold individual nodes; collapsed nodes show how many children they hold
  • Keys and values colour-coded by type: object keys, strings, numbers, booleans, null — the same palette in the editor and the tree
  • Editor with line numbers and syntax highlighting, matching the line and column in error messages
  • Search keys and values with match highlighting, or show only the paths that match
  • Per-node actions: double-click a value to edit it in place, copy a path ($.a.b[0]) or a value, delete a node, move array elements up and down
  • One-click conversions: Unicode escapes both ways, escape to string, to a Python dict, and to a GET query string
  • A pasted Python dict literal (single quotes, True / None) is converted to JSON automatically — no quote-fixing by hand
  • Repair: trailing commas, single quotes, `//` and `/* */` comments, unquoted keys, smart quotes, True/False/None, NaN — the JSON you fish out of a log fixed in one click
  • ⚠️ Repair only touches syntax and never guesses at intent (a bare identifier as a value is left alone), and it lists what changed and how many times so you can check it
  • Flatten / unflatten: collapse nesting into one level of `a.b.0.c` keys for a CSV, spreadsheet or form; keys that already contain a "." are called out
  • Undo and redo — Ctrl/⌘ + Z takes back a deletion or an edit, step by step
  • Validate with the error pinpointed to an exact line and column
  • Format with 2-space, 4-space or tab indentation, or minify to strip all whitespace
  • Drag in a .json file to open it, and download the result as .json
  • Large documents are handled without freezing the page

How to use

  1. Paste your JSON into the editor on the left, or drag a .json file onto it
  2. The tree appears on the right — click a triangle to fold or unfold any node
  3. Double-click any value to edit it in place, or select a row and use the bar underneath to copy its path or value, delete it or move it
  4. Use the Convert row to switch representations (Unicode, escaping, Python dict, query string); every step can be undone

FAQ

Is my JSON uploaded anywhere?
No. Parsing and formatting happen entirely in your browser memory. The page makes no network requests and keeps working offline.
Why do I get "unexpected character after number"?
JSON has a stricter number grammar than JavaScript: it rejects +1, .5, 01, 1. and Infinity / NaN. Convert those to valid JSON numbers first.
Can I undo a deletion or an edit made in the tree?
Yes. Deletions, edits, moves and key sorting are all written back to the input box straight away, and Ctrl/⌘ + Z undoes them one step at a time, up to 50 steps.
Does sorting keys affect arrays?
No. Array order carries meaning and sorting would destroy it, so only object keys are reordered. Arrays are always left exactly as they were, and the step can be undone.
How large a document can it handle?
Several megabytes is fine. Past a certain size live parsing pauses — press Ctrl/⌘ + Enter to parse once manually. Past the hard input limit you get a clear message instead of an unresponsive page.
Does the Convert row change my document?
Yes. The result is written straight back into the editor, and Ctrl/⌘ + Z undoes it step by step. If the result is not valid JSON — a Python dict or a query string, say — the tree stops and tells you so; the text view then shows the converted text, ready to copy or download.

Related tools