{}JSON FYI
Format JSON Online

Format JSON Online — Free Pretty Print Tool

Paste minified JSON and get clean, readable output in one click. Choose 2 or 4 spaces, tabs, or sort keys for stable diffs. Runs entirely in your browser.

Ready when you are.

Paste JSON on the left, or click Sample to try a quick example. Validation runs as you type — entirely in your browser.

EmptyType: Nodes: 0Depth: 0Size: 0 B

Why use an online JSON formatter?

Minified JSON is great for transport but unreadable for humans. An online formatter reinserts indentation and line breaks so you can scan the structure, find missing fields, and review diffs in version control without installing anything.

This tool is purely client-side: your JSON is never sent to a server, never logged, and works offline once the page is loaded. That makes it safe for production payloads, customer records, API tokens, and anything else you wouldn't want a remote service to see.

Examples

Single-line API response → 2-space indent
Input
{"id":42,"user":{"name":"Ada","email":"ada@example.com"},"tags":["admin","ops"]}
Output
{
  "id": 42,
  "user": {
    "name": "Ada",
    "email": "ada@example.com"
  },
  "tags": ["admin", "ops"]
}
Tabs
Input
{"a":1,"b":[2,3,4]}
Output
{
	"a": 1,
	"b": [2, 3, 4]
}
Sort keys for canonical diffs
Input
{"name":"Ada","id":7,"role":"engineer"}
Output
{
  "id": 7,
  "name": "Ada",
  "role": "engineer"
}

Sorting keys produces deterministic output — perfect for snapshot tests and clean git diffs.

Nested arrays
Input
{"matrix":[[1,2,3],[4,5,6],[7,8,9]]}
Output
{
  "matrix": [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
  ]
}
Empty containers stay compact
Input
{"a":{},"b":[],"c":null}
Output
{
  "a": {},
  "b": [],
  "c": null
}

Use cases

Frequently asked questions

How do I format JSON online?+

Paste your JSON into the editor above and click Beautify (or press ⌘B / Ctrl+B). Pick 2 or 4 spaces or tabs, optionally sort keys, and copy the formatted result. Everything happens in your browser.

Is it safe to format JSON online?+

Yes — JSON FYI never uploads your data. Parsing, formatting, and minification all run client-side in JavaScript. You can even disconnect from the network after the page loads.

What's the difference between formatting and minifying JSON?+

Formatting (also called pretty-printing or beautifying) adds indentation and line breaks for readability. Minifying strips all whitespace for the smallest possible payload. Both produce identical parsed values — only whitespace changes.

What indent should I use?+

2 spaces is the most common in modern JSON files and matches JSON.stringify(obj, null, 2). 4 spaces or tabs work too — pick whatever your team or linter expects.

Will formatting change the meaning of my JSON?+

No. JSON whitespace is purely cosmetic. The parsed object/array/value is identical before and after.

How big a file can I format online?+

Up to 10 MB. The formatter runs in your browser, so very large files may briefly freeze the tab while parsing.

Format JSON without leaving your terminal

One-liners for JS, Python, Go, and Ruby — pipe in JSON, get pretty output.

Format JSON in one line from your terminal

Skip the round-trip to a website — beautify directly from the command line.

npx prettier --stdin-filepath x.json
cat input.json | npx prettier --stdin-filepath x.json
Input
{"a":1,"b":[1,2,3]}
Output
{ "a": 1, "b": [1, 2, 3] }

Other JSON tools on JSON FYI

Every flow you need — formatter, validator, viewer, pretty print, repair, and the full workbench.

Related tools & guides