JSON Formatter
Format, validate and minify JSON with clear error messages.
Read and repair JSON without guesswork
JSON is unforgiving. One missing comma or one smart quote pasted from a document and the whole payload fails. A formatter that also tells you exactly where the problem is saves a surprising amount of time.
Paste your JSON above, choose indent size, and press Format. If the input is invalid, you get the line and character position instead of a generic error.
What you can do here
- Format. Pretty print with 2 or 4 spaces so nested objects become readable.
- Minify. Strip every unnecessary byte before sending a payload over the network.
- Validate. Confirm the text is valid JSON before it reaches an API or a config file.
- Sort keys. Order object keys alphabetically for stable diffs.
- Copy or download. Take the result as text or save it as a file.
Common JSON errors and what they mean
Unexpected token. Usually a trailing comma after the last item, or a missing comma between two items.
Unexpected end of input. A bracket or brace is not closed. Count the nesting levels.
Bad control character. A literal newline or tab inside a string. It needs to be escaped as \n or \t.
Unexpected token } in JSON at position 0. Sometimes the real problem is invisible. A byte order mark at the start of the file is a common cause when JSON is exported from a spreadsheet.
Why local processing matters here
JSON often contains exactly the things you should not paste into a random website: API keys, access tokens, customer records, internal configuration. Because this tool runs in your browser, the text is never transmitted. You can format a production token without wondering who logged it.
If you need to encode a value for transport, Base64 Encoder handles that next. For generating test payloads, QR Code Generator can turn a small JSON object into a scannable code.
Frequently asked
Does this send my JSON anywhere?
No. Formatting and validation happen in the browser. API keys, tokens and customer data stay on your machine.
What does the validator check?
It checks that the text is valid JSON according to the standard. That covers quotes, commas, brackets, trailing commas and unescaped control characters.
Can it fix broken JSON automatically?
It can reformat valid JSON. It will not guess at missing commas or unquoted keys, because a guess could silently change your data. The error message tells you where the problem is.
Is there a size limit?
There is no fixed limit. Very large payloads depend on your browser's memory, but files of tens of megabytes usually work.
Can I sort keys alphabetically?
Yes. Use the sort option before formatting to order object keys consistently.