JSON Formatter
Format, validate and minify JSON in your browser
Input
1 line, 0 characters
Tab inserts an indent. Press Escape and then Tab to move focus on, or Escape and then Shift+Tab to move it back. Shift+Tab on its own removes an indent, and moves focus when the line has none to remove.
Output
Formatted JSON appears here as you type.
Paste, drop or open a document to begin.
- CtrlEnterFormat
- CtrlShiftMMinify
- CtrlShiftCCopy output
- CtrlKClear
- EscDismiss error
- Size
- —
- Nodes
- —
- Depth
- —
- Keys total / unique
- —
It never leaves this tab
Parsing, formatting and validation run in your browser — in a Web Worker once the document is large enough for that to matter, so typing stays smooth on a multi-megabyte payload. Nothing is uploaded, and the page works offline.
Numbers survive
The formatter rewrites whitespace and nothing else, so 1.0 stays 1.0 and a 30-digit integer keeps all 30 digits. Tools built on JSON.parse and JSON.stringify destroy both, quietly.
Errors name themselves
A trailing comma is reported as a trailing comma, with the line, the column and a caret under the offending character. to see one.