JSON Formatter
Pretty-print and validate JSON in your browser. Paste or drop a file — nothing is uploaded.
Ads
Nothing leaves this device. No account required.
Pretty-print JSON locally
Paste messy JSON or drop a .json file. Formatly validates the payload, then pretty-prints it with your chosen indent (2 spaces, 4 spaces, or tabs). Optionally sort object keys for stable diffs. Parsing and formatting happen in the browser — nothing is sent to a server.
What this tool does and does not
The formatter is JSON.parse plus JSON.stringify with spacing. It rejects trailing commas, comments, and JSONC. If a config file is not strict JSON, fix it or use a different parser — this page will not silently strip comments. Numbers go through JavaScript’s JSON number rules: integers that do not fit in IEEE 754 already rounded before you see pretty output. That is the language, not a Formatly quirk.
Sort keys when you need a stable diff between two dumps. Leave keys unsorted when the original insertion order is part of the contract (some APIs still care). Minify is a different job: use the JSON Minifier when you want a single-line payload for production or a size check. Need YAML for humans or Kubernetes? Use JSON to YAML. Need a picture of this JSON for Slack or slides? Open JSON to Image.
When not to pretty-print
Do not pretty-print a minified production blob just to put it back on the wire — you undo the size win. Do not treat the formatter as a schema validator: it checks syntax, not whether userId is required. Secrets in the paste stay in this tab, but they are still on this machine; do not paste production tokens into a shared computer.
Proof it does not upload
Open DevTools → Network, paste a payload, format it. You should not see the JSON posted to Formatly. The editor and parser run here. Page scripts are not your document.