JSON Viewer & Formatter — Pretty Print, Tree, Minify | Omnvert
- Detect Base64-looking fields and decode to text (or warn when binary).
- Use JSONPath to highlight and filter large JSON: $.data.items[*].id
- Quick stats: keys, depth, arrays/objects, and approximate size.
About
See your JSON clearly with formatting, tree navigation and copy/export buttons.
Formatting JSON is a display decision, not a change to the data. Whitespace between tokens carries no meaning, so a pretty-printed document and its minified twin parse to identical values. Indent with two spaces when a human has to read the payload or when the file lives in git and you want line-level diffs. Minify when the bytes travel over a network or land in a database column. Compression narrows the gap but does not close it: gzip still has to move and decompress the padding you added.
Strict JSON is a much smaller language than most people remember. Keys and strings need double quotes, single quotes are invalid, keys cannot be bare identifiers, comments do not exist, and a trailing comma before } or ] is a parse error. The overwhelming majority of pastes that fail are JavaScript object literals rather than JSON — perfectly legal in a .js file, rejected the moment JSON.parse touches them. A parser that reports line and column turns that into a five-second fix instead of a hunt.
Several values that feel numeric have no representation at all. NaN, Infinity and -Infinity are not JSON, and JSON.stringify silently converts each of them to null. undefined behaves differently depending on where it sits: as an object property it and any function value are dropped entirely, while inside an array they become null, so [1, undefined, 3] serializes to [1,null,3] and quietly changes shape. Date objects become ISO 8601 strings and never come back as dates without a reviver.
Large integers are the failure that survives all the way to production. JSON numbers are parsed into IEEE-754 doubles, so anything above 9007199254740991 loses precision: a 19-digit snowflake ID or a Postgres bigint comes back rounded, usually with the last two or three digits wrong. Nothing throws — you just get a value that no longer matches any row. The fix is at the producer: serialize the identifier as a string, or use a parser that maps large integers to BigInt.
Deep documents are where a tree view earns its place. A Kubernetes manifest or a Stripe webhook nests eight or ten levels down, and reading that as raw text means counting braces. Collapse the branches you do not care about, expand the one you do, and use a path expression to jump straight to the field in question. Sorting keys is worth mentioning too: alphabetical order makes two dumps of the same object diff cleanly, but never re-serialize a payload whose signature you still need to verify — HMAC checks run against the exact raw bytes, and reordering keys invalidates them.
Encoding problems show up as mojibake or as escapes you did not expect. RFC 8259 requires UTF-8 for JSON exchanged between systems, and a byte-order mark at the front of a file is not part of the grammar — many parsers reject it outright, which is why a config file that looks perfect fails on line 1, column 1. Non-ASCII characters may appear literally as é or escaped as \u00e9; both are valid and equivalent. Characters outside the Basic Multilingual Plane, emoji included, are written as surrogate pairs like \ud83d\ude00.
JSON5 and JSONC exist because people kept wanting comments. VS Code reads .vscode/settings.json and tsconfig.json as JSONC, so // notes and trailing commas are accepted there — by that specific parser. package.json is strict JSON and will break npm if you annotate it. Knowing which dialect a file is in matters before you paste it into a validator: a JSONC file reported as invalid is not necessarily broken, it is simply being judged by the stricter grammar.
The everyday use is unglamorous and constant. An API returns a wall of text on one line and you want to see the shape of it. A response that should be JSON is actually an HTML error page, and pretty-printing it tells you that instantly. A field that should hold an object holds a string containing JSON, because something double-encoded it on the way through a queue. Before committing a config file — a CI pipeline, a service manifest, a locale bundle — a validation pass costs a few seconds and beats finding the trailing comma from a failed deploy log.