{
"hello": "world",
"items": [
1,
2,
3
]
}JSON Formatter, Validator and Tree Viewer
Format, validate, minify and explore JSON in a collapsible tree, entirely in your browser with no upload.
What it does
JSON Formatter validates and reformats JSON as you type, using your browser's own JSON parser. Pick 2 spaces, 4 spaces or tabs, switch to a collapsible tree to explore nested objects and arrays, and copy either the formatted or minified version. It suits developers checking an API response or a config file who want an instant, local answer.
How to use it
- Paste or type JSON into the input box; it is validated as you type.
- Choose 2 spaces, 4 spaces or Tabs, then switch between Code and Tree view.
- Copy the formatted or minified result with the copy buttons.
Example
- Input
- {"name":"Ana","active":true,"tags":["pt","dev"]}
- Output
- { "name": "Ana", "active": true, "tags": [ "pt", "dev" ] }
What happens to your file
- Your file or text is processed by code running in this browser tab. It is not uploaded to any server.
- The processing code is downloaded from this site with the page; nothing about your input is sent back.
- The result is created on your device and saved only when you choose to download it.
Limits
- Only strict JSON is accepted; comments and trailing commas are rejected like any other invalid syntax.
- The line and column hint for an error depends on your browser's own JSON parser error message and may not appear in every browser.
- Very large JSON documents are limited by your browser's available memory.
Questions
What happens if my JSON is invalid?
The tool shows the parser's error message. When the message includes a character position, it is also translated into a line and column number so you can find the problem faster.
Can I switch between spaces and tabs?
Yes. Choose 2 spaces, 4 spaces or Tabs from the indent selector; the formatted output updates immediately.
Is there a way to browse deeply nested JSON?
Yes. Tree view renders objects and arrays as expandable sections you can open and close, which is easier to scan than a long formatted block.
Does it validate as I type, or do I need to press a button?
It validates continuously. There is no separate validate button; errors and the formatted result update on every keystroke.
Can I get a minified version too?
Yes. A Copy minified button produces the same JSON with all whitespace removed, alongside the Copy formatted option.