JSON Formatter
Beautify or minify JSON, with precise error positions.
Use the JSON Formatter tool
What this json formatter does
JSON Formatter turns a wall of compact or badly indented JSON into a structure you can actually read. It parses the document strictly, then re-serialises it with two-space, four-space or tab indentation. Minify mode does the reverse: it strips every unnecessary space and newline for production payloads.
Because the parser runs inside this page, API keys, tokens and customer records pasted here are never transmitted. The formatter also reports the line and column where parsing failed, which is usually faster than hunting through the raw text yourself.
Why use it
- Inspect API responses and webhook payloads without installing an editor extension.
- Catch trailing commas, missing quotes and unescaped characters before they reach production.
- Produce compact JSON for config files, request bodies and embedded data.
How to use it
- 1Paste or type your JSON into the input panel.
- 2Choose an indent size, then press Format (or use the Minify action).
- 3If the document is invalid, read the error message showing the line, column and expected token.
- 4Copy the result or download it as a .json file.
Worked examples
Beautify a compact API response
Input
{"id":42,"name":"Ada","roles":["admin","billing"],"active":true}Output
{
"id": 42,
"name": "Ada",
"roles": [
"admin",
"billing"
],
"active": true
}Common syntax error
Input
{"name": "Ada",}Output
Unexpected token } — a trailing comma is not allowed in JSON.
JSON is stricter than JavaScript object syntax. Remove the comma after the last property.
Common mistakes
- Pasting JavaScript objects that use single quotes, comments or unquoted keys — JSON requires double quotes.
- Assuming a large document is invalid when the browser has actually truncated the paste; check the character count.
- Formatting untrusted JSON with a tool that uploads it to a server. Use a local formatter for secrets.
Frequently asked questions
Does the JSON formatter upload my data?
What is the largest JSON file I can format?
Does formatting change my data?
Can I sort keys alphabetically?
Related tools
All toolsJSON Validator
Pinpoint JSON errors by line and column, instantly.
JWT Decoder
Read JWT claims and optionally verify HMAC signatures.
Base64 Encoder
UTF-8-safe Base64 encoding, including URL-safe mode.
Regex Tester
Live regex matching, groups and replace preview.