Formatting, minifying, and inspecting JSON locally
REST responses, webhook deliveries, log records, and bundler manifests often arrive as a single dense line of text with optional whitespace stripped. Pasting that raw payload into this JSON formatter lets you pretty print JSON with 2 spaces, 4 spaces, or tabs, validate every token, or collapse it back to one line.
Choosing between Format, Minify, and Tree mode
Under the ECMA-404 JSON Data Interchange Syntax Standard, spaces, horizontal tabs, line feeds, and carriage returns outside quoted strings carry zero semantic weight. Format mode indents nested objects and arrays cleanly (data.json), whereas Minify strips insignificant whitespace (data.min.json).
Switching Mode to Tree renders an interactive collapsible hierarchy so you can expand deep API objects without scrolling through thousands of raw lines. Both Format and Tree respect your selected Indent width and Sort keys A–Z toggle.
Keeping bearer tokens and API payloads in your tab
Developers routinely inspect production payloads containing bearer tokens, session cookies, customer PII, and internal microservice URLs. Because every parse and serialization step executes inside your current tab, you can format and validate JSON without uploading confidential strings anywhere.
When an authorization header still contains a compact three-part token string, decode Base64URL payloads inside a JWT locally before inspecting the JSON claims.
Strict RFC 8259 syntax rules and parse error fixes
Reliable cross-language serialization requires strict grammar compliance. Under the IETF RFC 8259 JSON Data Interchange Standard, a valid document may contain only objects, arrays, double-quoted Unicode strings, decimal numbers, true, false, and null, which explains why JSONC comments, single quotes, and unquoted keys fail in Go, Rust, Python, and PostgreSQL parsers.
When an unexpected token or trailing comma breaks parsing, the error banner converts character offsets into 1-based line and column coordinates with a Go to line button. Teams working with Kubernetes or GitHub Actions manifests can also generate strict JSON from YAML manifests before validating.
| Broken input pattern | Why strict parsers reject it | Built-in hint message | Corrected JSON |
|---|---|---|---|
{"a": 1,} |
Trailing comma before closing brace | Remove the comma after the last item. |
{"a": 1} |
{'a': 'ok'} |
Single quotes instead of double quotes | JSON needs double quotes, not single quotes. |
{"a": "ok"} |
{a: 1} |
Unquoted object property name | Keys need double quotes around them. |
{"a": 1} |
{"a": 1 "b": 2} |
Missing comma between members | Is a comma missing before this? |
{"a": 1, "b": 2} |
// config |
JavaScript or JSONC comment syntax | JSON doesn't allow comments. |
Remove comment |
How does this formatter preserve 64-bit IDs and catch duplicates?
After validating strict JSON grammar, this parser scans numeric tokens outside quoted strings and replaces integers exceeding 53 bits with exact BigInt values, while simultaneously walking object scopes to flag duplicate keys. Standard browser JSON.parse() rounds large 64-bit identifiers and silently overwrites repeated property names.
Avoiding IEEE 754 rounding with BigInt tokens
Per the MDN Number.MAX_SAFE_INTEGER Documentation, JavaScript Number values rely on IEEE 754 double-precision floats, which cap exact integer representation at 9,007,199,254,740,991 (2^53 - 1). Formatting a 19-digit Snowflake ID or 64-bit database primary key with naive JSON.parse() corrupts the trailing digits.
By isolating integer literals of 16 or more digits that fail Number.isSafeInteger(), the formatter preserves exact digits across Format, Minify, Sort keys A–Z, and Tree views. When exporting tabular records for spreadsheets, you can use the JSON to CSV flattener with those 64-bit IDs intact.
Flagging duplicate object keys before silent overwrites
RFC 8259 recommends unique member names inside every JSON object, yet different backend languages resolve repeated keys inconsistently (some keep the first value, while JavaScript keeps the last). For inputs up to 500,000 characters, the scanner inspects every object scope and lists up to four repeated keys in a warning banner.
Catching repeated keys early prevents subtle configuration overrides and JSON Parameter Pollution bugs where an authentication gateway reads the first "role" field while a downstream microservice reads the last one. Fixing duplicates before saving ensures every parser produces identical data.
Sorting keys alphabetically and handling large files
Alphabetical key sorting and background worker offloading make large API responses predictable to compare and responsive to edit. Turning on Sort keys A–Z orders every nested object recursively using locale-aware comparison without altering array element order.
Deterministic key ordering for clean diffs
Two API responses with identical data often produce noisy line-by-line diffs when servers serialize object properties in different insertion orders. Checking Sort keys A–Z normalizes key ordering across every nested level in both Format and Tree modes so structural changes stand out immediately.
Background Web Worker offloading above 64 KB
Payloads under 65,536 characters (64 KB) format synchronously as you type, whereas larger inputs and .json files up to 20 MB switch automatically to a background thread. Following the MDN Using Web Workers API Guide, offloading heavy serialization with a 120 ms debounce keeps typing and scrolling responsive.
Tip: When comparing a large
20 MBexport against a database query, use Minify for compact storage or Sort keys A–Z before running a diff.
If your debugging session also involves inspecting database queries alongside API payloads, open the SQL formatter in this tab without uploading anything.