JSON viewer, formatter, and validator
Paste, drop or upload JSON, then read it as a tree, format, minify or validate it.
Click Format, Minify, or Validate to see the result.
Your JSON never leaves this browser — DevBox does not upload it or store it anywhere.
A JSON viewer, formatter and validator in one page
DevBox is a free JSON viewer and formatter that runs entirely in your browser. Paste a payload above and it will show the document as a collapsible tree, re-indent it, shrink it, or tell you exactly what is wrong with it. The JSON is never uploaded, never logged and never stored, which makes it usable for API responses, access tokens, customer records and anything else you would not paste into a remote service. Drop a file onto the editor, or upload one up to 5 MB.
Tree view turns the document into an expandable outline — every object and array reports how many items it holds, and Expand all or Collapse all moves the whole structure at once. It is the quickest way to read an unfamiliar API response without scrolling through thousands of lines.
Format (also called beautify or pretty-print) re-indents the document with two spaces, four spaces or tabs. Minify strips every insignificant space and line break and reports how much smaller the result is. Validate checks the document without changing it. Nothing runs while you type — the tool acts only when you choose an action, so a half-typed payload never floods the screen with errors.
Results can be read as highlighted text with line numbers or as that tree, and either can be copied or downloaded from the buttons above the output.
One page covers the jobs usually split across several tools: it is a JSON viewer, a JSON formatter, a JSON validator and a JSON minifier, and it is the same thing people look for under names like JSON beautifier, pretty printer or JSON lint.
Common JSON errors, and what they actually mean
Most JSON validators report where the parser gave up rather than what you did wrong: Unexpected token at a position that is often one character past the real mistake. DevBox names the mistake instead, points a caret at the exact character, and says what to write in its place. These are the errors it recognises by hand:
- Trailing comma
{ "a": 1, } - A comma after the last property or array item. Valid in JavaScript and Python, rejected by JSON.
- Single or curly quotes
{ 'a': 1 } - JSON strings and keys use straight double quotes. Curly quotes (“ ”) arrive when copying out of a document.
- Unquoted keys
{ a: 1 } - A JavaScript object literal is not JSON. Every key must be a double-quoted string.
- Python and JavaScript values
{ "ok": True } - True, False, None, undefined, NaN and Infinity are not JSON. Use true, false and null.
- Numbers with a leading zero
{ "zip": 007 } - JSON has no leading zeros. Quote identifiers such as zip codes to keep them intact.
- Invisible characters
{ } - A byte-order mark or non-breaking space that no editor shows. DevBox names the character and its position.
- Comments
// note\n{ "a": 1 } - JSON has no comment syntax. Strip // and /* */ before parsing, or use JSONC-aware tooling.
- Unterminated strings and brackets
{ "a": "x } - A quote or bracket that is opened and never closed. The error points at where it was opened.
Invalid JSON often hides several problems at once, so validation reports up to five issues in one pass rather than stopping at the first. Each one has a Jump to it link that puts your cursor on the offending character.
Questions about this tool
What is a JSON viewer?
A JSON viewer displays a JSON document as an expandable tree instead of raw text, so you can collapse the parts you do not care about and drill into the parts you do. It is the fastest way to understand an unfamiliar API response: every object and array shows how many items it holds, and you can open one branch at a time rather than scrolling through thousands of lines. Paste your payload above and choose Tree.
What is a JSON formatter?
A JSON formatter re-indents JSON so a person can read it. Minified JSON arrives as one long line; a formatter parses it and writes it back with one key per line and consistent indentation, without changing the data. A JSON beautifier and a pretty-printer are the same tool under different names, and a JSON validator is the half of it that only reports problems rather than rewriting anything.
Is this JSON viewer safe for private or confidential data?
Yes. Viewing, formatting, validating and minifying all run in your browser with the built-in JSON parser. The payload is never sent to a server, never logged, and nothing is stored between visits — closing the tab discards it. You can confirm this by opening your browser's network panel and watching that no request is made when you press Format.
How do I fix invalid JSON?
Paste it and press Validate. DevBox reports every issue it can locate with the line and column, the source line with a caret under the exact character, and a plain-language explanation — for example “Trailing comma” or “Booleans must be lowercase” rather than “Unexpected token”. Fix the first issue and validate again, since one mistake can mask the ones after it.
What does “Unexpected token” mean in JSON?
It means the parser reached a character that cannot start a value there. In practice it is almost always a trailing comma, a single or curly quote, an unquoted key, a missing comma, or an invisible character such as a byte-order mark. DevBox names which of these it found instead of reporting the raw parser message.
What is the best JSON formatter online?
Judge one on four things. Does it run in your browser rather than uploading your data to a server? Does it tell you what is wrong in words you can act on, with a line and column? Can it show large payloads as a collapsible tree as well as text? And does it work without an account, an extension, or a limit you will hit? DevBox was built against exactly that list, but apply it to whichever tool you choose — especially the first question, if the JSON holds customer data or tokens.
What is the difference between formatting, beautifying and minifying JSON?
Formatting and beautifying are the same thing: re-indenting JSON across multiple lines so it is readable. Minifying removes every space and line break to make the payload as small as possible for transport. Both produce exactly the same data — only the whitespace differs.
Does formatting change my data?
No. The JSON is parsed and re-serialised, so only whitespace changes. Key order, Unicode characters and \u escapes round-trip unchanged. One caveat applies to every JSON parser: numbers beyond the range JavaScript can represent exactly, such as 64-bit IDs, lose precision, so keep those as strings.
How large a JSON file can I view or format?
Uploads are capped at 5 MB, and pasted text has no fixed limit beyond what your browser can hold. Because the work happens on your machine, a very large payload is bounded by your own memory and CPU rather than by a server timeout or an upload quota.
Which indentation should I use — 2 spaces, 4 spaces or tabs?
Two spaces is the most common convention and what most formatters and linters default to. Four spaces suits deeply nested configuration that is read by people. Tabs let each reader choose their own width and are the accessible choice for anyone using a larger indent. All three are equally valid JSON.
JSON basics
What is a JSON file?
A JSON file is a plain text file, usually ending in .json, holding data written in JSON (JavaScript Object Notation) syntax: objects in curly braces, arrays in square brackets, and values that are strings, numbers, true, false or null. Because it is plain text you can open one in any editor — but a viewer that renders it as a tree is far easier to read once the file grows past a few dozen lines.
What is JSON and why is it used?
JSON is a text format for structured data. It is used almost everywhere because it is simple enough to read by eye, compact enough to send over a network, and supported by every mainstream programming language. Web APIs return it, configuration files are written in it, log pipelines emit it, and databases store it. It replaced XML for most web work because it carries the same nested structure with far less ceremony.
Is JSON a programming language?
No. JSON is a data format, not a language you write logic in. It has no variables, functions, loops or conditionals — only values and the structure that holds them. The name comes from JavaScript because the syntax was derived from JavaScript object literals, but JSON is language-independent and every major language can read and write it.
What is the difference between JSON and an API?
They are not alternatives. An API is an interface you call; JSON is one of the formats an API can use to send its answer. When people say “a JSON API” they mean an API whose requests and responses are encoded as JSON. The same API could return XML or Protocol Buffers instead, and the interface would be unchanged.
Is JSON better than CSV?
It depends on the shape of the data. CSV is smaller and opens directly in a spreadsheet, which makes it the better choice for flat rows and columns — a table of orders, say. JSON handles nesting, arrays and mixed types that CSV cannot express without awkward conventions, and it records the type of each value rather than leaving everything as text. Use CSV for tabular exports, JSON for anything hierarchical or typed.
How do I create a JSON file?
Open a text editor, write your data in JSON syntax, and save it with a .json extension — there is nothing else to it. Start with an object in curly braces, give each key a double-quoted name, separate pairs with commas, and leave no comma after the last one. Paste it into the viewer above and press Validate before you commit it, because one misplaced comma is enough to break it. Most languages will also generate one for you: json.dumps in Python, JSON.stringify in JavaScript.
Does ChatGPT use JSON?
Yes, throughout. The OpenAI and Anthropic APIs take JSON requests and return JSON responses, tool and function calls are defined and answered as JSON, and structured-output modes make the model return JSON matching a schema you supply. If you are debugging an LLM integration you will spend a lot of time reading JSON — and model-generated JSON is a common source of the trailing commas and unquoted values this validator names.
More DevBox tools
DevBox is a growing set of small developer utilities that run in the browser. Browse the toolbox — CSS and frontend helpers, encoding, IDs and timestamp tools are on the way.