Runs locally

JSON Formatter & Validator

Format, minify, validate and inspect JSON with a lightweight tree view. Runs locally in your browser.

Runs locally Your JSON never leaves your browser.
View mode

JSON Input

Waiting for JSON input.

JSON Output

Formatted, minified or inspected locally.

Statistics

Lines
0
Keys
0
Values
0
Objects
0
Arrays
0
Maximum Depth
0
Characters
0
Approximate Size
0 B

JSON Formatter and Validator

Paste JSON to format it for readability, minify it for transport, validate syntax, inspect nested data in a tree view, and review useful statistics without leaving the page.

How JSON formatting works

Formatting parses the JSON text into a JavaScript value, then serializes it back with consistent indentation. You can choose 2 spaces, 4 spaces or tabs depending on the style your project uses.

How to validate JSON

Validation runs automatically as you type and also when you press Validate. When the browser parser reports a location, the tool shows the message, character position, line and column so syntax problems are easier to find.

JSON formatting vs minification

Formatted JSON keeps whitespace and line breaks for humans. Minified JSON removes unnecessary whitespace, which is useful for compact fixtures, payload examples or configuration snippets where readability is less important.

Common JSON syntax errors

Common mistakes include trailing commas, missing quotes around object keys, unescaped quote characters inside strings, single-quoted strings, and missing closing braces or brackets.

JSON Tree View

Tree View renders objects and arrays as collapsible branches, while strings, numbers, booleans and null appear as leaf values. Expand All and Collapse All help when exploring deeply nested JSON.

Privacy

This JSON formatter runs in browser memory. It does not make an Ajax request, store your JSON in localStorage, or write your input to Laravel logs, sessions, cookies or a database.

FAQ

Does this JSON formatter upload my JSON?

No. Formatting, validation, tree rendering and statistics all run locally in your browser.

Can I minify JSON?

Yes. Use Minify to produce compact JSON, then copy or download the result as a .json file.

Does Tree View use a third-party library?

No. The tree is rendered with lightweight native DOM APIs.

Can it validate primitive JSON?

Yes. Valid JSON can be an object, array, string, number, boolean or null.