JSON Pretty Printer

Standard formatting puts every array item on its own line, which makes short lists such as ["read", "write"] needlessly tall. The pretty printer keeps short lists of simple values on one line and sorts keys if you want, so the output is ready to paste into documentation or a pull request.

Input

The result will appear here.

Ready In: 0 B Processed locally

How to use the JSON Pretty Printer

  1. Paste JSON.
  2. Choose indentation and whether to sort keys.
  3. Press Pretty print and copy the result into your document.

Features

  • Compact arrays: lists of numbers, strings and booleans stay on one line when they fit in 80 columns
  • Recursive key sorting for stable output
  • Lossless values

Supported input

Valid JSON.

Limitations

  • Arrays that contain objects or other arrays are always expanded, for readability.

Privacy

Everything this tool does happens in your browser. What you paste or open is never uploaded, stored, logged or used for advertising. Closing the tab discards it. Read the privacy policy.

Frequently asked questions

01How is this different from the JSON Formatter?

The formatter uses one-item-per-line everywhere, which is ideal for diffs. The pretty printer optimises for human reading by keeping short lists compact.

02Is my data uploaded anywhere?

No. This tool runs entirely in your browser tab. Your input is never sent to our servers, stored, or logged. You can disconnect from the internet after the page loads and it keeps working.