{}JSON Formatter, Validator, Minifier & Tree Viewer Online
Paste a one-line API response and get neatly indented, syntax-highlighted JSON instantly. Switch to the tree view to fold and unfold each level and copy the path of any field. The tool validates as you type and, when something is wrong, tells you the exact line and column and what is probably missing, with a one-click jump to the spot. It can also minify to a single line, sort keys recursively, escape and unescape strings, convert between \uXXXX escapes and real characters, and copy or download the result. Everything runs in your browser, so API payloads and config files never leave your machine.
Loading tool...
How to use JSON Formatter
- 1Paste JSON into the left box, or click "Open file" or drop a .json file onto it
- 2The formatted result appears on the right instantly; choose "Minify" for a single line or "Tree view" to browse level by level
- 3Adjust the indent, tick "Sort keys" or "Escape non-ASCII" if needed, then "Copy result" or "Download"
FAQ
- The JSON is reported as invalid but I cannot see why
- The status bar shows the line and column of the error, the likely cause (a trailing comma, an unquoted key, a missing bracket) and a snippet around the spot. Click "Go to error" to select the offending character in the input. The most common mistakes are a comma after the last item, single quotes, unquoted keys and comments; none of these are allowed in standard JSON.
- The response contains JSON escaped inside a string. How do I read it?
- Click "Unescape" first. The tool unwraps the outer JSON string (turning \" into " and \n into a line break) to reveal the inner JSON, which you can then format normally. The reverse, "Escape", prepares a JSON snippet for embedding in a string field.
- Non-ASCII text shows up as \u4e2d\u6587
- Just format it: by default the tool decodes \uXXXX escapes into the real characters. If you need the opposite, for example a config that only accepts ASCII, tick "Escape non-ASCII".
- How large a file can it handle?
- There is no hard limit on pasted text and files up to 20 MB can be opened. JSON of a few megabytes formats normally; for very large documents syntax highlighting is switched off to stay responsive, and the tree view renders long arrays in batches.
- Do very long numbers lose precision?
- Yes, this is a JavaScript limitation: integers above 2^53 (such as 19-digit snowflake IDs) lose precision when parsed. If your JSON contains such IDs and you need the exact values, use the tool only to inspect the structure, or have the backend return those IDs as strings.
- Is my data uploaded anywhere?
- No. Parsing, formatting and the tree view all run inside your browser with no network requests. For convenience the input is kept in your browser's local storage so it is still there next time; click "Clear" to remove it.
- Does it support JSON5, JSONC (comments) or single quotes?
- Only standard JSON (RFC 8259) is validated at the moment. Comments, single quotes and trailing commas are reported as errors with their position, so that the result can be read by any parser.