🌐 EN

🧾 JSON Formatter

Indent JSON for readability or minify it to one line, and get the exact line:column of any syntax error. Explore the structure with a collapsible tree view.

GUIDE

Learn more

01

1. Pretty Print vs Minify

Pretty printing adds indentation and line breaks to make JSON easy for humans to read, while minifying strips all unnecessary whitespace and newlines to shrink file size. Pretty-printed JSON is great for debugging during development, while minified JSON reduces payload size for real API responses and production deployments. This tool lets you choose 2-space, 4-space, or tab indentation to match your project's code style.

02

2. Pinpointing JSON Errors Precisely

Error messages thrown by JSON.parse() vary widely across browser engines, often making it hard to know exactly where the problem is. This tool includes its own hand-written scanner that walks the JSON grammar (objects, arrays, strings, numbers, literals) directly, so it always reports the exact same "line N, column M" regardless of which browser you're using. That makes it quick to spot common mistakes like a missing comma, an unquoted key, or an unterminated string.

03

3. Understanding Deeply Nested JSON with Tree View

Deeply nested JSON is hard to follow as plain text β€” it's easy to lose track of which bracket closes which. The tree view renders objects and arrays as collapsible/expandable nodes, so you can drill into just the part you care about. Clicking the copy button next to any node copies that value's path (e.g. $.tools[1]) to your clipboard, ready to paste directly into code that needs to reference it.

Frequently asked questions

Is my JSON sent to a server?
No. Parsing, formatting, and validation all happen in your browser via JSON.parse() only β€” no backend API is ever called. Sensitive API payloads or config values stay private.
The error message is terse β€” how do I read it?
It shows a line:column plus which token was expected, e.g. "at 3:5 β€” Expected ',' or '}'". The input box also auto-selects that exact line so you can jump straight to it.
If I change the indent option, does my existing text update automatically?
No β€” the indent choice only takes effect the next time you click "Pretty Print". Changing the dropdown alone doesn't reformat anything.
What do "keys" and "depth" mean in the tree view stats?
"Keys" is the total count of object properties across the whole JSON document, and "depth" is how many levels deep the most nested value sits β€” useful as a rough gauge of structural complexity.