JSON formatter & viewer.
Paste on the left to validate and format it, browse and edit on the right. Click a key or value to change it. Changes flow both ways. Nothing leaves your browser.
Tree click to edit · + add · × delete
Waiting for valid JSON.
About this tool
One page that does the jobs usually spread across five: it validates as you type, formats (beautifies) and minifies, sorts keys, shows the document as a tree you can fold, and lets you edit it in place. Everything runs in the page, so sensitive payloads never touch a server.
What it does
| Job | How |
|---|---|
| JSON validator | Parses on every keystroke. Invalid input shows the parser's message and, in browsers that report it, the line and column, so a missing comma or trailing bracket is found in seconds. |
| JSON formatter / beautifier | Format rewrites the source with two-space indentation and one key per line. Copy JSON puts the formatted document on your clipboard. |
| JSON minifier | Minify strips all whitespace for the smallest payload; Copy minified does the same straight to the clipboard without changing the source. |
| JSON viewer | The tree on the right shows types, nesting and array lengths. Large documents start folded past the first level; Expand all and Collapse all do what they say. |
| JSON editor | Click any value to edit it: type a JSON literal such as 42, true, null, "text" or {} and it becomes that type; anything that is not valid JSON is kept as a string. Click a key to rename it (order is preserved, duplicates are refused). Hover a row for add, copy and delete. Enter commits, Escape cancels. |
| Sort keys | Recursively sorts every object's keys, which makes two documents comparable. For the actual comparison use the JSON diff checker, which has the same option built in. |
Common JSON errors
- Trailing comma after the last item in an object or array. Legal in JavaScript, not in JSON.
- Single quotes around strings or keys. JSON requires double quotes.
- Unquoted keys:
{name: "x"}is a JavaScript object literal, not JSON. - Comments: JSON has none. Strip
//and/* */before parsing. - NaN, Infinity, undefined: not JSON values. Use
nullor a string. - Smart quotes pasted from a document, or a BOM at the start of a file.
- Big integers: JavaScript parses numbers as 64-bit floats, so IDs above 253 lose precision. Send them as strings.
Uses
- Reading an API response or a log line that arrived minified.
- Finding the one syntax error in a config file.
- Hand-editing a fixture or a request body without counting brackets.
- Turning a formatted document back into a compact one for a query string or an environment variable.
- Decoding the payload of a JWT and reading it as a tree.