JSON Formatter
Free online JSON formatter and minifier. Prettify or minify JSON with validation and error highlighting — all in your browser.
- Paste your JSON into the input area.
- Click Prettify to pretty-print, or Minify to compress.
- Select indent size (2 spaces, 4 spaces, or tab) and optionally sort keys alphabetically.
- Copy the result or fix any errors shown in the error banner.
FAQ
What is JSON formatting?
JSON formatting (pretty-printing) adds consistent indentation and line breaks to compact JSON, making it human-readable. This tool supports 2-space, 4-space, or tab indentation.
What does JSON minification do?
Minification removes all unnecessary whitespace from JSON, producing the smallest possible string. This is ideal for APIs and config files where byte size matters.
Does this tool validate my JSON?
Yes. Both Prettify and Minify validate your JSON first and highlight the exact line and position of any syntax error — missing commas, unquoted keys, trailing commas, and more.
Is my JSON data sent to a server?
No. All processing happens entirely in your browser. Your JSON never leaves your device.