Paste messy JSON and read it at a glance
Raw JSON from an API response or log file can look like one long wall of text. This JSON viewer turns it into a clean, color-coded, collapsible tree so you can find what you need in seconds — no setup, no sign-up, nothing to install.
Everything runs inside your browser. Your data is never sent to any server, so you can safely paste API keys, private configs, or production data.
How to use the JSON viewer
- Paste your JSON into the input box above (or click Load sample to try it out).
- The viewer instantly renders a formatted, syntax-highlighted tree.
- Click any ▶ arrow next to an object or array to collapse or expand that branch.
- Use the search bar to jump straight to any key or value inside the tree.
- Switch to Table view when you have an array of objects — each object becomes a row, keys become column headers.
- Copy the formatted result, or hit Minify to strip whitespace back out.
Worked example — an API response you can actually read
Imagine you get this back from a weather API (all on one line, the way most services return it):
{"city":"Berlin","temp_c":18,"conditions":{"sky":"cloudy","wind_kph":22},"forecast":[{"day":"Mon","high":20},{"day":"Tue","high":17}]}
After you paste it, the viewer pretty-prints it like this:
{
"city": "Berlin",
"temp_c": 18,
"conditions": {
"sky": "cloudy",
"wind_kph": 22
},
"forecast": [
{ "day": "Mon", "high": 20 },
{ "day": "Tue", "high": 17 }
]
}
You can now collapse conditions to hide it, or switch to Table view to see the forecast array as a two-column table — day and high. That makes scanning multiple records much faster than reading nested brackets.
How to inspect JSON like this in code
Sometimes you want a quick in-terminal pretty-print rather than a browser tool. Here are the two most common ways.
Python
import json
raw = '{"city":"Berlin","temp_c":18}'
parsed = json.loads(raw)
print(json.dumps(parsed, indent=2))
# Output:
# {
# "city": "Berlin",
# "temp_c": 18
# }
json.dumps() with indent=2 is Python's built-in pretty-printer. No extra libraries needed.
JavaScript (Node.js)
const raw = '{"city":"Berlin","temp_c":18}';
const parsed = JSON.parse(raw);
console.log(JSON.stringify(parsed, null, 2));
// Output:
// {
// "city": "Berlin",
// "temp_c": 18
// }
The third argument to JSON.stringify() sets the indent size. Use 2 or 4 — both are common style choices.
How the JSON viewer works (under the hood)
When you paste JSON, the viewer runs it through a parser that reads every character and builds an in-memory object tree. Each node in that tree — string, number, object, array, boolean, or null — is rendered as its own collapsible block with color coding by type. The JSON specification (json.org) defines exactly what's valid, and the parser flags anything that breaks those rules with a clear error message and line number.
No network calls happen at any point. The entire parse-render cycle runs in JavaScript inside your tab.
Navigating large or deeply-nested JSON as a collapsible tree
Big JSON files — config dumps, API responses with hundreds of records, nested schemas — are painful to read line by line. The tree view is built for this.
- Collapse entire branches by clicking the arrow next to any object
{}or array[]. This hides sub-keys you don't care about right now so you can focus on the top-level structure first. - Search keys and values with the search bar. Type a key name like
forecastand the viewer jumps straight to it and highlights every match — even if it's buried ten levels deep. - Table view for arrays of objects is the fastest way to compare records side by side. Paste an array of 50 user objects and you instantly get a spreadsheet-style view — no manual scrolling through nested brackets.
- Copy any node by right-clicking a branch to grab just that subtree as formatted JSON.
Because everything runs in the browser, there's no file size limit imposed by a server. Very large files (think 10 MB+) may slow the render slightly depending on your device, but your data never leaves your machine — not even a byte.
When to use a JSON viewer vs. other tools
| Situation | Best tool |
|---|---|
| Reading an API response or config file | JSON viewer (this page) |
| Checking if your JSON is valid | JSON Validator |
| Cleaning up JSON for a PR or docs | JSON Beautifier |
| Trimming whitespace before storing or sending | JSON Minifier |
| Converting JSON to a YAML config file | JSON to YAML Converter |
| Converting a YAML file back to JSON | YAML to JSON Converter |
The JSON viewer is the right choice when your goal is reading and exploring data — not producing a specific output format. If you need a printed copy with a specific indent style, the JSON Pretty Print tool gives you more control over that.
When NOT to use it: for structured data that has relationships better shown as a table (think a full database export), a spreadsheet or SQL tool will serve you better than a nested tree view.
Paste your JSON above and see every key and value laid out clearly — it only takes a second.