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.
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
{"id":42,"user":{"name":"Ada","email":"ada@example.com"},"tags":["admin","ops"]}{
"id": 42,
"user": {
"name": "Ada",
"email": "ada@example.com"
},
"tags": ["admin", "ops"]
}{"a":1,"b":[2,3,4]}{
"a": 1,
"b": [2, 3, 4]
}{"name":"Ada","id":7,"role":"engineer"}{
"id": 7,
"name": "Ada",
"role": "engineer"
}Sorting keys produces deterministic output — perfect for snapshot tests and clean git diffs.
{"matrix":[[1,2,3],[4,5,6],[7,8,9]]}{
"matrix": [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
}{"a":{},"b":[],"c":null}{
"a": {},
"b": [],
"c": null
}Use cases
- Reading API responses
Paste a single-line response from your terminal, browser DevTools, or curl and immediately see the structure.
- Cleaning up commits
Format JSON config files before committing so reviewers see meaningful diffs, not whitespace churn.
- Documenting API examples
Pretty-print payloads for your API docs so they're consistent across every endpoint.
- Sharing in Slack or GitHub
Drop a formatted JSON block into chat or an issue instead of one unreadable line.
- Snapshot testing
Sort keys before snapshotting so test output doesn't flip when serializers reorder fields.
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.
Skip the round-trip to a website — beautify directly from the command line.
cat input.json | npx prettier --stdin-filepath x.json
{"a":1,"b":[1,2,3]}{ "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.
Pretty-print with custom indent and sort keys.
Strict RFC 8259 syntax check with line + column.
Browse JSON as an interactive collapsible tree.
Compare two JSON files structurally with paths.
Convert arrays into spreadsheet-ready CSV.
Well-formed XML with attributes and indenting.
Idiomatic YAML 1.2 for Kubernetes & Compose.
Beautify JSON with JS- or Python-style indent.
Pinpoint errors with a catalog of common fixes.
Validate data against a JSON Schema — powered by Ajv.
All tools in one editor: validate, format, view, query.