JSON Formatter, Validator & Viewer
Format, fold, repair and convert JSON — entirely in your browser, nothing uploaded.
Input
Ctrl/Cmd + Enter to formatNeed this data in a spreadsheet? Convert JSON to Excel →
|What Is a JSON Formatter?
A JSON formatter takes JSON that has been squeezed onto one line and re-prints it with newlines and indentation, so you can actually read it. JSON ignores whitespace completely — the two versions below are identical to any parser. The difference is entirely for humans.
From This (minified)
{"id":8842,"customer":{"name":"Sarah Johnson","vip":true},"items":[{"sku":"KB-88","qty":1}],"total":89.99}To This (formatted)
{
"id": 8842,
"customer": {
"name": "Sarah Johnson",
"vip": true
},
"items": [
{ "sku": "KB-88", "qty": 1 }
],
"total": 89.99
}API responses arrive minified because every removed byte is bandwidth saved. That is the right choice for machines and the wrong one for you at 2am trying to work out why an order total is wrong.
How to Format JSON Online in 4 Steps
- Paste your JSON into the left pane. Or use Upload for a
.jsonfile, or Load URL to pull it from an endpoint. - The right pane formats as you type — nothing to click. Pasting opens a full-screen workspace so you have room to read.
- Choose your indentation: 2 spaces, 4 spaces, or tabs.
- Use the fold arrows to collapse sections, then Copy or Download.
JSON Validator: How to Check If Your JSON Is Valid
Valid JSON formats instantly. Invalid JSON gets you the exact line and column, the offending text, and a red marker in the gutter. Here is a document with one mistake:
{
"name": "Sarah",
"role": "admin" <-- missing comma
"active": true
} The error reads line 4 — but the mistake is on line 3. This catches everyone out, so it is worth understanding why: the parser only discovers something is wrong when it reaches "active" and finds a string where it expected a comma or a closing brace. The reported position is where the parser gave up, not where you went wrong. If the flagged line looks fine, check the line above it.
How to Fix Broken JSON Automatically
Most invalid JSON fails for a handful of predictable reasons — it was hand-written, copied out of JavaScript, or printed by Python. When the error is one of those, an Auto-repair button appears. Here is what it does to a document containing every common mistake at once:
Before (will not parse)
{
// an order
order_id: 'A-10432',
"vip": True,
"items": [
{ "sku": "KB-88" },
],
"discount": undefined,
}After (one click)
{
"order_id": "A-10432",
"vip": true,
"items": [
{ "sku": "KB-88" }
],
"discount": null
}| Mistake | Fix applied |
|---|---|
// comments | Stripped — JSON has no comment syntax |
order_id: | Key wrapped in double quotes |
'A-10432' | Single quotes converted, inner quotes escaped |
True / False / None | Python literals lowercased to JSON equivalents |
[ … ], | Trailing commas removed |
undefined / NaN | Replaced with null |
| Smart quotes from Word | Converted to straight quotes |
The repair runs on a scanner that tracks whether it is inside a string, so structural fixes never touch your actual string contents. The button only appears when the repaired text genuinely parses — you will never be handed a fix that still fails. Each error is explained in common JSON errors and how to fix them.
JSON Viewer: Reading Large Files with a Tree View
A 4,000-line API response is not readable as text no matter how neatly it is indented. The Tree tab collapses every object and array down to its shape:
▼ $ : { 3 keys }
status : "ok"
▶ results : [ 240 items ]
page : 1 From there you expand only the branch you care about. Every row shows its child count, you can filter by key, value or path, and hovering a row reveals copy path, which yields something like $.results[3].customer.email — ready to paste into code. The formatted JSON view folds the same way, so you can work in whichever representation suits you.
How to Minify JSON and Cut Payload Size
Minify strips every byte that existed only for readability and tells you how much you saved — typically 15–30% on a real payload. Use it before storing JSON in a database column, embedding it in a config file, or sending it over a slow connection. Keep the formatted copy for humans; ship the minified one.
Convert JSON to CSV, YAML and XML
The tabs above the output pane convert the parsed document without a trip through another tool. Given this input:
{
"users": [
{ "id": 1, "name": "Alice", "meta": { "role": "admin" } },
{ "id": 2, "name": "Bob", "meta": { "role": "editor" } }
]
}CSV
id,name,meta.role
1,Alice,admin
2,Bob,editorYAML
users:
- id: 1
name: Alice
meta:
role: adminXML
<users>
<item>
<id>1</id>
<name>Alice</name>
</item>
</users> Notice the CSV: the wrapper object was skipped and users became the rows, while the nested meta.role flattened into a column. That is almost always what you want — a wrapper is metadata, not data. For a real spreadsheet with typed columns rather than raw CSV text, use the JSON to Excel converter; to go the other way, the Excel to JSON converter.
JSON Formatter vs Parser vs Validator vs Beautifier
These names get used interchangeably and mostly describe the same operation from different angles:
| Term | What it means |
|---|---|
| Parser | Turns JSON text into an in-memory structure |
| Validator | Reports whether that parse succeeded, and where it failed |
| Formatter / Beautifier / Pretty Print | Re-serialises the structure with readable whitespace |
| Viewer / Editor | Presents it interactively, usually as a collapsible tree |
| Minifier | Re-serialises with all optional whitespace removed |
This page does all of them, because in practice you always want them together.
Formatting Is Not the Same as Validating Your Data
This tool checks syntax — whether the text is parseable JSON. It does not check whether the data is right for your application. This is perfectly valid JSON:
{ "user_id": "not-a-number", "email": "definitely not an email" }Syntactically flawless, semantically useless. Catching that second kind of problem needs JSON Schema, which lets you declare required fields, types and value ranges, then validate documents against them.
How to Open and Parse JSON in Excel
A common reason for landing on a formatter is a JSON file that has to end up in a spreadsheet. Excel cannot open .json by double-clicking, and renaming the extension does not help. The working routes are Power Query, a converter, or a script — compared in how to open a JSON file in Excel, with the step-by-step Power Query walkthrough in importing JSON with Power Query and the scripted approach in converting JSON to Excel in Python.
Is It Safe to Paste Sensitive JSON Here?
Yes. Parsing, formatting, repair and every conversion run entirely in your browser using JavaScript. There is no upload and no server round-trip, so your data never leaves your machine — you can confirm this by opening your browser network tab while you use the page.
That is not true of every online formatter. Several send the payload to a server, and some offer "save online" features that store it. If you are handling customer records, API keys or anything under an NDA, check where the processing happens before pasting. Our privacy policy sets out exactly what this site does and does not collect. The one exception is Load URL, which by definition makes a request from your browser to the address you supply — that request goes to that server, not to ours.
Frequently Asked Questions
What is the maximum file size?
Uploads are capped at 10 MB. Parsed JSON typically occupies six to ten times the file size in memory, so a 20 MB file can need 200 MB of RAM and risks freezing the tab. For bigger documents see working with large JSON files.
Why do I get a "Trailing data" or "Extra data" error?
Your file is almost certainly JSON Lines — one JSON object per line with no wrapping array. It is a different format that standard parsers reject. See converting JSONL to Excel.
Does formatting change my data?
No. The document is parsed and re-serialised, so only whitespace changes and key order is preserved unless you press Sort keys. One caveat that belongs to JSON itself rather than this tool: numbers are IEEE 754 doubles, so an integer beyond 253 can lose precision. If you handle IDs that large, transmit them as strings.
Why did Load URL fail?
Almost always CORS. A server has to explicitly permit cross-origin requests from other sites, and most APIs do not. Download the file and use Upload instead.
Do I need to install anything or sign up?
No. It runs in any modern browser, there is no account, and it is free.