JSON Formatter and Beautifier

Format and pretty print JSON online. Turn minified or messy JSON into readable, indented, syntax-highlighted text with 2 spaces, 4 spaces or tabs.

JSON input

1

Result

Waiting for input

About this tool

Formatting (also called beautifying or pretty-printing) adds line breaks and indentation so the structure of JSON is easy to read. It only changes whitespace; keys, values and their order stay the same unless you choose Sort keys.

What does a JSON formatter do?

A JSON formatter, also called a beautifier or pretty printer, adds line breaks and indentation so the structure of the data is easy to read. Only whitespace changes. Keys, values and their order stay the same, unless you choose Sort keys.

Before: {"name":"Asha","tags":["dev","api"]}

After:
{
  "name": "Asha",
  "tags": [
    "dev",
    "api"
  ]
}

Which indentation should I use?

Two spaces is the most common choice in JavaScript and web projects. Four spaces is common in Python and Java projects. Tabs let each reader pick their own display width. Use whatever your project or team already uses so file diffs stay clean.

Format and validate in one step

The formatter only produces output when the JSON is valid. If something is wrong you get the exact line and column of the error instead, so formatting doubles as a quick validity check.

How to use it

  1. Paste your JSON into the input box.
  2. Choose 2 spaces, 4 spaces or tabs.
  3. Copy the result or download it as a .json file.

Frequently asked questions

Why format JSON?

Minified JSON is hard to read. Formatting makes API responses and config files easy to review and debug.

Does formatting change my data?

No. Only whitespace changes.

Can I sort the keys?

Yes. Use Sort keys to order every object alphabetically, which is handy for comparing files.

More JSON tools

JSON Checker – Validate JSON OnlinePaste your JSON into this free JSON checker to validate it instantly. Any error is pinpointed by line and column, so you can fix it in seconds.Online JSON Editor with Find and ReplaceEdit JSON online with live validation, find and replace (including regex), key sorting and undo. Everything runs in your browser.JSON Minifier – Compress JSON OnlineMinify JSON online by removing every unnecessary space and line break. See the size before and after, then copy or download the result.JSON to CSV ConverterConvert JSON to CSV online. Paste an array of JSON objects and get a CSV ready for Excel, Google Sheets or a database, with nested objects flattened into columns.CSV to JSON ConverterConvert CSV to JSON online. The first row becomes the keys, and each following row becomes a JSON object. Dotted headers are rebuilt into nested objects.JSON to YAML ConverterConvert JSON to YAML online for Kubernetes manifests, Docker Compose files, CI pipelines and other configuration. Paste valid JSON and copy the YAML.YAML to JSON ConverterConvert YAML to JSON online. Paste YAML from a config file and get valid, formatted JSON, with syntax errors explained.JSON Diff Checker – Compare JSON OnlineCompare two JSON documents online and see exactly what was added, removed or changed, listed by path. Click any difference to jump to it.JSON Tree Viewer – Explore JSON VisuallyView JSON as a collapsible tree online. Expand only the branches you need instead of scrolling through long, deeply nested text.

Advanced JSON tools

Need more than the basics? Our developer tools go further.