Skip to content
Free tool · Data & formats

JSON Formatter & Validator

Paste JSON to pretty-print, minify or sort it, and find syntax errors by exact line and column. Browse large documents in a collapsible tree — all processing happens in your browser.

Runs in your browser — nothing is uploadedNo sign-up · no tracking of your input

Input JSON

Your JSON is parsed locally in this browser. It is never sent to a server or stored.

Output

How to use the JSON Formatter & Validator

  1. 1

    Paste your JSON

    Paste an API response, a config file or a log line into the input panel, or load the example. Files of several megabytes are fine.

  2. 2

    Fix errors

    Invalid JSON is reported with the line, the column and an excerpt that points to the problem, such as a trailing comma or single quotes.

  3. 3

    Format and export

    Choose 2 spaces, 4 spaces or tabs, minify or sort keys, then copy the result, download it as a .json file or explore it in the tree view.

FAQ

JSON Formatter & Validator: frequently asked questions

How do I find the error in invalid JSON?

The validator shows the line and column of the first syntax error, a short description and the affected line with a caret under the position. Common causes are trailing commas, single quotes, unquoted property names, comments and missing commas between values.

Is my JSON sent to a server?

No. Parsing, formatting and validation run with JavaScript in your browser. The data is not uploaded, logged or stored, so you can safely check responses that contain internal data.

What is the difference between formatting and minifying JSON?

Formatting (pretty printing) adds line breaks and indentation so people can read the structure. Minifying removes all unnecessary whitespace to make the payload as small as possible for transfer or storage. Both keep the data identical.

Can I sort JSON keys alphabetically?

Yes. Sort keys orders the properties of every object alphabetically at all nesting levels while keeping the order of array elements. This makes it easy to compare two documents or keep config files stable in version control.

Why do large numbers change after formatting?

JSON numbers are read as JavaScript numbers, which are exact only up to 9,007,199,254,740,991. Larger integers such as some database IDs lose precision; APIs should send those values as strings.