JSON Formatter & Validator
Pretty-print, minify, or explore JSON as a collapsible tree, with syntax errors shown inline.
Formatted live as you type. Nothing leaves your browser.
Output
Indentation
Result
How to format and validate JSON online
Paste your JSON
Drop raw JSON into the input. It is parsed and reformatted live on every keystroke.
Pick Pretty, Minified, or Tree
Pretty produces indented, readable output, Minified collapses the document onto one compact line, and Tree opens it as a collapsible outline you can expand node by node.
Set the indentation
In Pretty mode, choose 2 spaces, 4 spaces, or tabs to match your project's style.
Copy the output
A green Valid JSON note confirms the input parsed, and Copy to clipboard takes the formatted result.
Why use this tool
Beautify, minify, or explore as a tree
The same input pretty-prints for reading, minifies for payloads, or opens as a collapsible tree, and switching modes reformats instantly.
Collapsible tree view
Tree mode renders the document as an expandable outline with key names, array indices, and a child count on each collapsed object or array, plus Expand all and Collapse all controls.
Three indentation styles
Choose 2 spaces, 4 spaces, or tab indentation so the formatted output drops straight into your codebase.
The real parser error, inline
Invalid input shows the browser's own parse error message, typically including the character position where parsing failed.
Explicit validity signal
A Valid JSON confirmation appears under the output whenever the document parses, so a quiet result never means maybe.
Config files stay yours
Everything is parsed on your device. API responses and environment configs you paste are never uploaded or retained.
About this tool
This JSON formatter validates and reformats JSON with the same strict parsing rules your JavaScript code follows in production. As you type or paste, the document is re-parsed and re-emitted, either pretty-printed with your chosen indentation or minified to a single line. When parsing fails, the tool surfaces the browser's error message unchanged, which usually pinpoints the offending character position.
The everyday cases are familiar: making a minified API response readable enough to debug, tracking down the trailing comma or unquoted key that breaks a config file, shrinking a payload before embedding it in a script or an HTTP request, and normalising indentation before a code review. Because the validator applies the strict JSON standard rather than a loose approximation, a green Valid JSON result means the document will load anywhere standard JSON is accepted, from package manifests to CI pipelines.
Nothing you paste is transmitted; response bodies full of customer records or keys stay in the tab. When the JSON came out of a token rather than an API, the JWT decoder unpacks it with the time claims explained. To reshape a valid document into other formats, JSON to YAML and JSON to CSV handle the conversion.
Frequently asked questions
- How does the JSON formatter work?
- Paste or type JSON into the input and it is parsed and re-formatted live as you type. Choose pretty-print to get clean, indented output, or minify to strip every unnecessary space and newline into a single compact line. The copy button copies the result to your clipboard.
- What happens when my JSON is invalid?
- The tool shows the parser error inline, including the position or line and column where parsing failed, so you can find the problem quickly. Nothing crashes and your input is left untouched while you fix it.
- Is my JSON uploaded or stored anywhere?
- No. All parsing and formatting happens locally in your browser. Your data never leaves your device, never touches a server, and is not logged.
- What indentation options are supported?
- When pretty-printing you can choose 2 spaces, 4 spaces, or tabs. Minify removes all indentation and whitespace for the smallest possible payload, which is handy for embedding JSON in code or sending it over the wire.
- What is the tree view for?
- Tree mode shows the document as a collapsible outline instead of raw text. Each object or array is a node you can expand or collapse, with its key name or array index and a count of how many children it holds, so you can drill into a large or deeply nested payload without scrolling through thousands of lines. Expand all and Collapse all reveal or fold the whole document at once, and Copy still gives you the formatted text.
- Does it handle large JSON files?
- Yes. Formatting runs client-side and the output area scrolls rather than stretching the page, so large documents stay usable. Very large inputs depend on your device memory since everything is processed in the browser tab.
Related tools
JSON to YAML
Convert JSON to YAML and YAML back to JSON, in both directions, with your choice of indentation.
JSON to CSV
Flatten a JSON array of objects into clean CSV, with nested keys expanded to dotted columns and your choice of delimiter.
CSV to JSON
Paste CSV and get a clean JSON array of objects, with header detection and automatic number and boolean typing.
API Key Generator
Generate cryptographically random API keys and tokens in hex, base62, or base64url, with control over length, an optional prefix, and bulk output.
ASCII Table Reference
The full ASCII character set with decimal, hex, octal, binary, and HTML codes. Search by code, character, or name.
Atbash Cipher
Mirror the alphabet so A swaps with Z, B with Y, and so on. Atbash is its own inverse, so one field both encodes and decodes as you type.