How to use the JSON formatter
- Paste your JSON into the box.
- Choose an indentation: 2 spaces, 4 spaces or tabs.
- Choose Format to make it readable, Minify to remove whitespace, or Validate only to check it. Invalid JSON shows an error message describing the problem.
Common JSON errors
- Trailing commas after the last item in an object or array.
- Single quotes instead of double quotes around keys and strings.
- Keys without quotes, such as
{name: "Sam"}instead of{"name": "Sam"}. - Comments, which standard JSON does not allow.
Private by design
API responses and configuration files often contain keys, tokens or personal data. This formatter runs entirely in your browser, so the JSON you paste is not sent to a server.
Worked example
This minified input:
{"name":"Sam","roles":["admin","editor"],"active":true}
formats with 2-space indentation into one key per line, with the array items indented underneath roles, so the structure is easy to scan. Minify turns it back into a single line.
Formatting uses the browser's own JSON parser, so the result follows the official JSON standard (RFC 8259). Numbers, strings, true, false, null, objects and arrays are supported. Very large numbers beyond JavaScript's safe range can lose precision when formatted, so treat IDs longer than 15 digits with care.
Frequently asked questions
How do I validate JSON?
Paste it into the formatter. Valid JSON is formatted; invalid JSON shows an error message explaining what went wrong.
What does minify JSON mean?
Minifying removes spaces and line breaks that are not needed, making the file smaller for sending or storing.
Is my JSON uploaded?
No. Formatting and validation happen in your browser.