🧾 JSON Formatter, Validator & Minifier
Paste raw JSON to beautify, validate or minify it in one click. Errors are pinpointed with line and column, keys can be sorted alphabetically, and the result can be copied or downloaded as a .json file — all offline, in your browser.
How it works
- Paste JSON into the input box and choose Format, Minify or Validate.
- Invalid JSON is reported with the parser’s message translated into a line and column position so you can jump straight to the problem.
- Formatting supports 2 spaces, 4 spaces or tabs, and can recursively sort object keys — useful when diffing two documents.
- Minify removes every unnecessary byte of whitespace and reports how many bytes you saved.
- Download writes the current output to a .json file locally. Nothing is uploaded at any point.
Examples
- Input
{"a":1,"b":[true,null]}→ Format → pretty-printed with your chosen indentation. - Input
{"a":1,}→ error reported at the trailing comma, with exact line and column. - Minify a 12 KB pretty-printed config to a single line and see the byte savings.
Frequently asked questions
Why does my JSON fail to parse?
The usual culprits are trailing commas, single quotes instead of double quotes, unquoted keys and comments — none of which JSON allows. The error message shows the exact line and column so the fix is fast.
Does formatting change my data?
No. Formatting and minifying only add or remove whitespace. Key order is preserved exactly unless you explicitly enable key sorting, which never changes values — only the order keys are written in.
Is there a size limit?
Only your browser’s memory. Multi-megabyte JSON files format fine on modern devices. Because everything runs locally, even confidential payloads are safe to paste.
Can it fix my JSON automatically?
It validates and pinpoints errors rather than silently guessing — silent fixes corrupt data. If your input is “JSON-ish” config (comments, trailing commas), strip those first; the error location guides you line by line.
Related tools
More JSON tools →JSON Minifier
Compact valid JSON by removing insignificant whitespace after a real parse.
JSON String Escape
Escape text for JSON or unescape a JSON string literal in the browser.
Background Remover
Remove the background from a photo and save a transparent PNG — free, private, no sign-up.
QR Code Generator
Make QR codes for links, Wi-Fi, UPI, WhatsApp and more — free PNG and SVG downloads.