JSON Formatter — Format, Validate, Minify, Escape Online
Paste JSON → format with 2/4 space indent, validate with line + column error display, minify to one line, escape/unescape strings. 100% client-side, no upload.
Why use this tool
Parse error includes not just message but exact position (line 12, column 34) for quick fix.
Internal JSON (API responses, configs) is not uploaded anywhere. Native JSON.parse in browser.
Format / Validate / Minify / Escape / Unescape — no need for 5 separate tools.
How to use
- 1Paste JSON into the left textarea.
- 2Pick indent: 2 (default) or 4 spaces.
- 3Click Format (pretty) / Minify (one line) / Validate (check only) / Escape (to JSON string).
What is a JSON Formatter?
A JSON formatter turns minified, hard-to-read JSON into pretty-printed form with clear indentation. Useful for debugging API responses, reading config files, or validating JSON before pasting into code.
This tool uses V8/SpiderMonkey native JSON.parse — fastest and most standards-compliant. Errors include positions so you find issues quickly.
- ✓Format with 2 or 4 space indent
- ✓Minify (strip whitespace)
- ✓Validate with line + column display
- ✓Escape (JSON-encode string)
- ✓Unescape (decode JSON string)
- ✓100% client-side, no upload
- ✓Native JSON.parse — ECMAScript standard
FAQ
Is there a size limit?
No hard cap, but JSON >10MB will be slow as the browser parses on the main thread. We recommend <5MB.
Does it support JSON5 / JSONC (comments)?
No. Native JSON.parse is strict — no comments or trailing commas allowed.
Does formatting preserve key order?
Yes. JSON.stringify preserves insertion order of objects.