JSON Formatter & Validator
FormatEverything runs locally in your browser — nothing is uploaded
Paste JSON on the left — a collapsible tree shows up here
This document nests deeper than 2000 levels, so it cannot be written back out as text. The tree still works; editing and export are paused.
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
- Paste your JSON into the editor on the left, or drag a .json file onto it
- The tree appears on the right — click a triangle to fold or unfold any node
- 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
- 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
JSON to Code
FormatTurn JSON into TypeScript interfaces, Go structs, Java classes or Rust structs, with missing keys marked optional. Runs locally in your browser.
JS Minify & Beautify
FormatMinify JavaScript (comments and whitespace stripped, /*! licences kept) or beautify it by re-indenting on braces and semicolons. Nothing is uploaded.
JWT Decoder & Verifier
EncodingDecode a JWT and verify an HS256, HS384 or HS512 signature with your secret, reading exp and nbf as dates. All local to your browser.
Text Diff
TextCompare two blocks of text online and highlight added, removed and unchanged lines, so only the lines that changed are marked. Runs in your browser.
SQL Formatter
FormatFormat SQL online: one clause per line, consistent keyword case, subqueries indented deeper. Minify strips comments and extra whitespace, all locally.
JSON5 Converter
FormatParse JSON5 into strict JSON: comments, unquoted keys, single quotes, trailing commas, hex and Infinity all work, with errors located by line.