JSON Formatter
Messy JSON in, readable JSON out.
JSON
Formatted in your browser. Nothing you paste is stored or sent.
About
Paste JSON and get it back pretty-printed with 2 spaces, 4 spaces or tabs, or minified onto one line. Optionally sort the keys, and if the JSON is broken you get the line and column of the error. Everything runs in your browser: nothing you paste is sent or stored.
- Does it validate my JSON?
- Yes. If it parses, you get the formatted result. If not, you get the error and, where the browser reports it, the line and column. It checks syntax only, not a schema.
- Why does my JSON fail with a trailing comma or single quotes?
- Strict JSON allows neither. Keys and strings need double quotes, and the last item in an object or array can't have a comma after it. Comments aren't allowed either.
- Does it change my numbers?
- Usually not, but it reads numbers as JavaScript does. Integers beyond 9007199254740991 lose precision, and 1.0 prints as 1. If exact big numbers matter, keep them as strings.
- What does Sort keys do?
- It sorts object keys A to Z at every level. Arrays keep their order, since order means something there.
- Is it safe to paste private data?
- The text never leaves this tab and isn't saved anywhere; it's gone when you close or reload the page.