JSON Formatter

Format, minify and validate JSON, optionally with sorted keys.

IndentationKeys
Formatting and validation happen as you type.

Usage

Paste JSON into the left box. The formatted result appears on the right as you type.

  • Indentation chooses between 2 spaces, 4 spaces, tabs or minified output without any whitespace.
  • Sort A–Z sorts the keys of every object alphabetically, which makes two JSON documents easier to compare.

If the input isn't valid JSON, the error is shown with its line and column, and its line number is highlighted.

Limits

Numbers are read as JavaScript numbers, so integers above 9007199254740991 (2⁵³ − 1) lose precision, and 1.0 is written as 1. Duplicate keys keep the last value.

Privacy

This tool runs entirely in your browser and does not send any data to a server.

Something not working as expected? Let me know.