JSON Formatter & Validator

Paste JSON to format it, validate it, or minify it. Errors are reported with the exact line and position.

Valid JSON.

Size
Keys
Max depth
Values

Output

About the json formatter

Most JSON formatters on the web send your payload to a server, which is a problem when the payload is an API response containing customer data or an access token. This one parses and formats entirely in your browser, so nothing is transmitted. Beyond formatting, it validates strictly and reports the precise position of a syntax error, which is usually a trailing comma, a single quote where JSON requires double, or an unquoted key.

How to use the json formatter

  1. Paste your JSON into the input area.
  2. Click Format to pretty-print it with consistent indentation, or Minify to strip all whitespace.
  3. If the JSON is invalid, read the error message for the line and position of the problem.
  4. Copy the formatted result or download it as a file.

Frequently asked questions

Why is my JSON invalid when it looks fine?
The usual culprits are a trailing comma after the last item, single quotes instead of double quotes, unquoted object keys, or a JavaScript comment. JSON is much stricter than JavaScript object literal syntax, and none of those are legal.
Is my data sent to a server?
No. Parsing and formatting use the browser built-in JSON engine and run entirely on your device. The page makes no network requests after it loads, so it is safe for API responses containing credentials or personal data.
What indentation should I use?
Two spaces is the most common convention for JSON and is what most tooling defaults to. Four spaces is also fine. What matters most is being consistent within a project.
Can it handle very large files?
Files up to a few megabytes format without noticeable delay. Beyond roughly 10 MB the browser may become unresponsive while parsing, so a command-line tool such as `jq` is a better fit for very large payloads.