What is JSON Formatter?#
JSON Formatter takes pasted JSON and formats it into a readable shape, with consistent indentation that makes the structure visible at a glance.
When the input has a syntax error, the faulty line and the reason are shown instead of the result. For common slips such as trailing commas or single quotes, a repair option can rewrite the input into valid JSON.
How to Use#
Paste JSON into the input, and the formatted result appears right away. Copy or download it when you want to take it elsewhere.
Indentation, minification, and key sorting apply as soon as they change, so there is nothing else to press.
Formatting Options#
- Indentation: 2 spaces, 4 spaces, or a tab per level. Applies to pretty-printed output only.
- Minify: compresses the result into a single line without whitespace. Useful before embedding JSON in code or sending it over the wire.
- Sort keys: orders object keys from A to Z at every level, comparing by character code so uppercase letters sort before lowercase. Array order never changes, and repeated keys keep their relative order.
Common Use Cases#
- Reading an API response: paste the body and scan the structure instead of counting braces.
- Normalizing a config file: line up indentation and key order before saving it back.
- Checking JSON in logs: isolate one fragment and confirm it parses before digging further.
FAQ#
No. Formatting, validation, and repair all run in your browser, and the pasted text never leaves your device.
Trailing commas, single-quoted strings, unquoted property names, comments, NaN and Infinity, and full-width symbols. A repair is offered only when those fixes turn the whole input into valid JSON. If a missing bracket, a mistyped keyword, or a broken string remains, no repair is applied, and the error position points at where to fix it by hand.
No. Only object keys are reordered. Array elements, including the objects inside them, stay exactly where they were.
Notation is normalized the way JSON itself writes numbers, so 1.0 becomes 1 and 1e3 becomes 1000. Values are unchanged, except that integers beyond double precision can lose digits.
Notes#
- Applying the repair replaces the input with the fixed text, so the result can be checked and adjusted in place.
- Identifiers that must keep exact digits, such as order numbers, are safer as strings.
- Large inputs can make the page slow while formatting.