JSON Formatter & Validator
Paste JSON to beautify, minify or validate it. Errors point to the exact line and column. Your data never leaves your browser.
Output
- Objects
- –
- Arrays
- –
- Keys
- –
- Max depth
- –
Key facts
- Privacy
- Runs in your browser: your files and text are never uploaded
- Last updated
How to format JSON
Paste JSON into the Input box. It is validated as you type. Valid JSON appears in the Output panel with syntax colors; invalid JSON shows the line and column of the first error with a pointer to the exact spot.
Choose Beautify for readable, indented output or Minify for the smallest payload. Sort keys A–Z makes two JSON documents easy to compare.
Frequently asked questions
What is the difference between Beautify and Minify?
Beautify adds line breaks and indentation so people can read the structure. Minify removes all optional whitespace to make the smallest payload for APIs and config files.
Why is my JSON invalid?
The most common causes are a trailing comma after the last item, keys or strings in single quotes, unquoted keys, and comments. JSON allows none of these. The error box shows the line and column where parsing stopped.
Is it safe to paste API responses or tokens?
Yes. Formatting happens with your browser’s built-in JSON parser. Nothing is sent to a server or saved.
Can JSON have comments?
No. Standard JSON (RFC 8259) doesn’t allow comments or trailing commas. Remove them, or use a format that allows them, such as JSONC or JSON5, if your tools support it.
What’s the difference between JSON and a JavaScript object?
JSON is text with stricter rules: keys must be in double quotes, strings use double quotes, and values can only be strings, numbers, true, false, null, arrays and objects. Functions, undefined, dates and comments aren’t allowed.
Sources
The rules and figures this tool uses come from:
Related tools
- Base64 Encode / DecodeText and files to and from Base64
- URL Encode / DecodePercent-encode text and inspect URLs
- Hash GeneratorMD5, SHA-1, SHA-256 and SHA-512 for text and files
- JWT DecoderInspect header, payload, expiry and signature
- Regex TesterTest patterns with live match highlights
- Unix Timestamp ConverterEpoch time to dates and back
- Binary ConverterBinary, decimal, hex and octal, two’s complement and text to binary
- Password GeneratorStrong random passwords, locally generated