Skip to content
Toolbench

JSON Formatter

Format and beautify JSON instantly.

Runs entirely in your browser

Loading tool...

How to use

  1. Paste or type JSON into the input panel.
  2. Choose an indent width, and turn on Sort keys if you want a stable, comparable order.
  3. Select Format JSON. Errors report the line and column so you can fix them in place.
  4. Copy the result or download it as a .json file.

Features

  • Two-space, four-space and tab indentation.
  • Optional recursive key sorting, which makes two documents easy to diff.
  • Syntax errors reported with a line and column instead of a raw parser message.
  • Runs entirely in your browser, so nothing you paste is uploaded.

Frequently asked questions

Is my JSON sent to a server?
No. Formatting happens in your browser using the built-in JSON parser. The data never leaves your device, which makes this safe for configuration files and API responses that contain secrets.
Why does sorting keys not reorder my arrays?
Order is meaningful in a JSON array, so reordering it would change the data. Only object keys are sorted, and the sort is applied at every level of nesting.
How large a file can it handle?
It is limited by your browser memory rather than an upload cap. Documents of a few megabytes format without trouble; very large files may briefly freeze the tab while the parser runs.
Why is my JSON rejected when it looks correct?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, or unquoted keys. All three are valid JavaScript but not valid JSON.

Find JSON syntax errors and see exactly where they are.

Convert configuration to YAML with the strings that would change meaning quoted — including the country code that loads as false.

What actually changed between two JSON documents — by value and path, not by line.

Strip whitespace to make JSON as small as possible.

Indents XML without editing it: mixed content keeps its spacing, and a tag that does not match is named with the line it is on.

JSON Formatter — Format JSON Online