About this tool
Turn a one-line API response into readable, indented JSON, or squeeze a pretty file back down to a single line before shipping it. You choose the indentation and can sort every object's keys so two documents line up for comparison. If the input has a syntax error, the tool points to the exact line and column instead of failing silently. Everything runs in your browser, so private payloads never leave your machine.
How to use JSON Formatter
- Paste JSON into the left box, or open a .json file.
- Pick 2 spaces, 4 spaces, tabs or Minify.
- Tick “Sort keys A–Z” if you want a stable key order.
- Copy the result or download it as a file.
Frequently asked questions
Does formatting change my data?
No. Only whitespace changes. Sorting keys reorders object properties, which JSON treats as unordered anyway; array order is always kept.
How big a file can it handle?
Documents of several megabytes format in well under a second on a typical laptop, because parsing uses the browser's native JSON engine.
Why does it say my JSON is invalid?
Common causes are trailing commas, single quotes, comments or unquoted keys. The error message shows the line, column and a likely fix.