JSON Formatter & Viewer
Paste JSON to check that it's valid, format or minify it, and explore it as a collapsible tree with search and copyable paths. Parsing and formatting run in your browser, with no size limit or sign-up.
How to use JSON Viewer
- Paste your JSON into the Input panel.
- Fix any error shown under Invalid JSON; it gives the message and, where the browser reports it, the line and column.
- Choose an indent of 2 spaces, 4 spaces or tabs, then click Format to pretty-print it, or Minify to strip the whitespace.
- Expand or collapse the tree, search keys and values, and use Copy path on any node.
Frequently asked questions
How do I check if my JSON is valid?
Paste it into the input. If it isn't valid, the viewer shows Invalid JSON with the error message and its position so you can fix it.
Why is my JSON invalid?
The usual causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, comments, and a missing closing bracket or brace. These are allowed in JavaScript but not in JSON.
What is the difference between formatting and minifying JSON?
Formatting adds line breaks and indentation so people can read it. Minifying removes all unneeded whitespace to make it as small as possible for sending or storing. Neither changes the data.
Can I search inside a large JSON file?
Yes. The search box matches both keys and values and opens the parts of the tree that contain matches. Large arrays are shown in chunks so the page stays responsive.
How do I compare two JSON documents?
Use the diff checker and tick JSON (ignore key order). Both sides are formatted with sorted keys first, so only real changes show up.
Is my JSON sent to a server?
No. Parsing, formatting and the tree view all happen in your browser. Your input is kept in this browser's local storage so it survives a reload.
JSON rules that trip people up
JSON is defined in RFC 8259. It is stricter than the JavaScript it came from:
- Strings and keys need double quotes: {"name": "Ada"}, not {name: 'Ada'}.
- No trailing commas: [1, 2, 3] is valid, [1, 2, 3,] is not.
- No comments, and no undefined, NaN or Infinity.
- Whole numbers beyond 9,007,199,254,740,991 (2^53 − 1) lose precision when parsed in JavaScript, which includes this viewer. Large IDs are safer sent as strings.
- A JWT's payload is JSON inside Base64URL: decode it with the JWT decoder first, then paste the payload here.
- If a key appears twice in one object, the last value wins when parsed here; other parsers may differ.