Skip to content

JSON Formatter

Pretty-print, sort keys and fix broken JSON

Input JSON

Empty

Output

Empty

How to use

  1. Paste JSON into the input editor, drop a file onto it or click Upload.
  2. The formatted result appears on the right instantly. Switch the output between Pretty and Minified.
  3. Pick 2 spaces, 4 spaces or tabs, and enable Sort keys to order properties alphabetically.
  4. If the JSON is broken, click Repair to fix quotes, commas and comments automatically.
  5. Copy the output or download it as a .json file.

About the JSON formatter

APIs, logs and config files often deliver JSON on a single line. This formatter parses the document and rewrites it with one property per line and consistent indentation so you can read, review and edit it. Because the document is parsed rather than just re-indented, the output is always valid JSON and syntax errors are reported with the exact line and column.

Everything happens locally in your browser. The tool is safe for API keys, customer data and internal configuration because no request is ever sent to a server.

Frequently asked questions

It parses your JSON and prints it again with consistent indentation and line breaks, so nested objects and arrays become easy to read. You can choose 2 spaces, 4 spaces or tabs and optionally sort keys alphabetically.