JSON Formatter
Format, minify and validate JSON online with syntax highlighting and precise error location. Everything runs locally in your browser — your data is never uploaded.
How to use
- Paste or type the JSON text in the box above, then click "Format" to get an indented, syntax-highlighted output.
- "Minify" collapses the JSON into a single compact line — handy for smaller API payloads or config entries.
- "Validate" only checks whether the syntax is correct and reports the approximate line and column of an error; it never changes your input.
- Once formatted or minified, click the "Copy" button in the top-right corner of the result area to copy the output.
- Use "Example" to load a sample document instantly, and "Clear" to reset the input and results any time.
FAQ
What rules does the validation follow?
It parses strictly against standard JSON (RFC 8259): keys and strings must use double quotes, trailing commas and comments are rejected, and literal line breaks inside strings must be escaped as \n. Unclosed quotes or brackets are flagged as syntax errors.
Is the reported "line and column" accurate?
Yes. The location is derived from the parser's exact error offset, so common mistakes such as a missing comma, mismatched brackets or an unterminated string point you close to the offending spot.
Is my data uploaded to a server?
No. Formatting, minifying and validation are all performed by local browser scripts, so the content you paste never leaves your device.