About this tool
This tool formats, minifies and validates JSON in your browser and shows a collapsible tree view of the parsed data. Developers use it when reading API responses, debugging configuration files or preparing compact payloads. JSON (JavaScript Object Notation) is a text format for structured data built from objects, arrays, strings, numbers, true, false and null, defined by RFC 8259 and ECMA-404.
How it works
Paste JSON or upload a file, then choose Format, Minify or Validate. Format adds whitespace with 2- or 4-space indentation, and Minify removes whitespace outside strings. Both preserve original strings, number spelling and key order, so the output contains the same data you started with.
Validation uses the browser’s strict JSON parser: comments, trailing commas and single-quoted strings are not JSON. Error line and column are shown when the browser supplies a position, which points you to the first problem. Turn on the tree view to expand and collapse nested objects and arrays, then copy or download the formatted text.
Example
Formatting {"count":2,"items":[true,null]} with 2-space indentation puts count and items on their own lines and each array value on its own indented line beneath items. Minifying the result returns the original 31-character line. It removes only unnecessary whitespace, never spaces inside string values.
Now add a trailing comma after null and validate. The parser rejects the input, and where the browser reports a position, the error points near the closing bracket. Delete the comma and the same text formats cleanly.
Assumptions and limits
Input is limited to 1,000,000 characters or a 1 MB file, and formatting stops at 200 nesting levels. Validation follows strict JSON, so JSON5, comments and trailing commas are rejected. It checks syntax only, not a JSON Schema. The tree view shows up to 100 entries per level and 6 levels, and may round large numbers.
Frequently asked questions
Can I format JSON containing large integers?
Yes. Formatted text and downloads retain numeric tokens such as 9007199254740993 without rounding. The optional tree view uses native JavaScript numbers and may show rounded values for integers above 9007199254740991. Rely on the formatted text, not the tree, when exact IDs or amounts matter.
Can I paste confidential JSON?
This tool processes JSON locally without uploading or saving it. Still, avoid working with secrets on a shared device and do not share clipboard contents with untrusted applications. Removing tokens and personal data before debugging is a good habit in any tool.
Why is my JSON invalid?
Common causes are single quotes instead of double quotes, unquoted keys, trailing commas after the last item, comments, and values like undefined or NaN. Use the reported line and column, when shown, to find the first problem.
What is the difference between formatting and minifying JSON?
Formatting adds line breaks and indentation so people can read the structure. Minifying removes all whitespace outside strings to make the text as small as possible. Both represent exactly the same data.
Does this check my JSON against a schema?
No. It only checks that the text is well-formed JSON. Whether required fields exist or values have the right types must be checked with a JSON Schema validator or your application.
Link with your values
Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.
| Parameter | Value | If omitted |
|---|---|---|
jsonJSON input | not accepted in links: enter it on the page | |
indentIndentation (spaces) | one of: 2, 4 | default 2 |
treeTree view | true or false | default false |
Examples
?indent=4?indent=4&tree=true
Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.
Result elements: [data-result-block="json-output"]