How to format or minify JSON
Paste a complete JSON value and choose Format to indent it or Minify to remove whitespace outside strings. Formatting uses two spaces by default, adjustable from 1 to 10. Both actions validate the syntax first. Use Copy to take the result back to your editor or request body.
What changes during formatting?
Only whitespace outside quoted strings changes. The tool preserves property order, duplicate property names, and exact number literals such as 9007199254740993. Some applications interpret duplicate names differently, so remove duplicates deliberately if you need interoperable JSON.
Why is my JSON invalid?
JSON object keys and strings require double quotes. The last item in an array or object cannot have a trailing comma. Comments and JavaScript literals such as undefined are invalid. A single number, string, boolean, or null is a valid complete JSON value.
Both actions support up to 500,000 characters. Formatting supports up to 100 levels of nesting.