JSON Nerd
A cartoon badger in round glasses, thinking

JSON Beautifier

Pretty print JSON so it is easy to read.

Runs in your browser. Nothing you type is uploaded.

How to beautify JSON

Paste minified or messy JSON and press Format to turn it into neatly indented, readable text. Choose 2 spaces, 4 spaces or tabs, and tick Sort keys to order object keys alphabetically, which makes two versions of the same data easier to compare.

Why pretty print JSON?

API responses and config files are often a single long line. Indentation shows the structure at a glance, so nested objects and arrays are easy to follow, and line-based tools such as diffs and code review work properly.

FAQ

Does beautifying change my data?

Only the whitespace changes (and key order if you turn on sorting). The values are the same, and very large integers beyond JavaScript's safe range may be rounded, as in any browser-based tool.

What if my JSON is invalid?

You get an error with the line and column, so you can fix it and try again.

Can I go back to compact JSON?

Yes, use the JSON minifier.

More JSON tools

  • JSON formatter: Format, minify and validate JSON in one place.
  • JSON validator: Check JSON syntax and find the exact line and column of an error.
  • JSON minifier: Strip whitespace to make JSON as small as possible.
  • JSON to Go struct: Generate Go struct definitions with json tags from a JSON sample.
  • JSON to TypeScript: Generate TypeScript interfaces or types from a JSON sample.
  • JSON to Python: Generate Pydantic models, dataclasses or TypedDicts from a JSON sample.
  • JSON to Rust: Generate Rust structs with serde derives from a JSON sample.