deftools.io Developer Tools

JSON Formatter & Validator

Format, validate, and minify JSON with real-time syntax checking. Beautify messy payloads, compress for production, catch errors before they break your app, and share via deep-link.

0 chars
Indent
0 chars
Path:

About this tool

Paste any JSON to instantly validate, beautify, minify, and explore it. As you type, the input is parsed and shown in two forms: a re-indented text view you can copy, and a collapsible tree view for navigating deeply nested structures without scrolling through walls of text.

Type into the Filter box above the tree to instantly narrow it to matching keys and values — every match is auto-expanded and you can jump between them with the arrow buttons (or Enter / Shift+Enter). For example, pasting a 500-line API response and typing error collapses everything except the nodes that mention it.

Click any node in the tree to copy its JSON path (e.g. $.meta.stars or $.tags[1]) — handy for writing JSONPath / jq expressions or referencing a field in code. Choose between 2-space, 4-space, or tab indentation, and optionally sort object keys alphabetically to diff two payloads.

The parser is lenient: it accepts JSONC (single-line // and block /* */ comments) and trailing commas, then reports parse errors with the line and column where the problem starts.

Big integer detection: JavaScript numbers can only safely hold integers up to 2⁵³−1 (9,007,199,254,740,991). When the formatter detects integer literals in your JSON that exceed this limit — common with Twitter/X snowflake IDs, Stripe IDs, or database row IDs — it flags them with a ⚠ marker and names the affected keys so you know which values lost precision during display.

FAQ

What is the difference between beautify and minify?

Beautify (Format) re-indents the JSON with line breaks and spaces so a human can read it. Minify removes all whitespace to produce the smallest valid string — useful for saving bandwidth when sending JSON over the network.

How do I copy the path to a specific value?

Click any value or bracket in the tree view. The full JSON path appears in the Path box and is copied to your clipboard automatically. Array indices use square brackets (tags[1]), object keys use a dot (meta.stars).

How does the tree search work?

Type any substring into the Filter box above the tree. Matching keys and values are highlighted in yellow and the tree auto-expands their parent nodes. Use Enter (next) and Shift+Enter (previous) to cycle through matches, or press Esc to clear. Matching is case-insensitive on both keys and values.

Does this tool accept JSON with comments (JSONC)?

Yes. Lines starting with //, block comments inside /* */, and trailing commas before a closing } or ] are stripped before parsing, so config files like tsconfig.json or .eslintrc.json work without manual cleanup.

Is my data sent to a server?

No. All parsing and formatting happens entirely in your browser. Nothing is uploaded, so you can safely paste API keys, credentials, or private payloads.

Can I share a JSON payload with a coworker?

Yes. Click the Share button to copy a link that encodes the current JSON, indent setting, and sort-keys toggle in the URL (?j=...&indent=4&sort=1). Opening that link loads everything exactly as you had it — useful for pasting into a ticket, PR, or chat to discuss a specific payload.

Why does my number show a ⚠ warning in the tree view?

JavaScript numbers are 64-bit floats and can only safely represent integers between −9,007,199,254,740,991 and 9,007,199,254,740,991. If your JSON contains an integer outside that range — such as a Twitter/X snowflake ID like 1842632362112000000 — the raw value is correct in the formatted text output, but the tree view displays the rounded JavaScript representation. The warning tells you which keys are affected so you don't accidentally copy a corrupted value. For BigInt-safe JSON processing, consider using a server-side tool or a JSON parser that supports the JSON BigInt proposal.

How is this different from the JSON Tree Explorer?

The JSON Formatter is a full beautifier, minifier, and validator with JSONC support and deep-link sharing — its tree view is a helpful extra. The <a href="/json-tree-viewer" class="text-accent hover:underline">JSON Tree Explorer</a> is a focused tree-only tool with no formatting UI, built purely for navigating large payloads.

More developer tools

Copied!