JSON Formatter

Runs in your browser See how to verify it

JSON input

Tab indents, Shift+Tab outdents, and Enter keeps JSON indentation. Press Escape, then Tab, to leave the editor.
1 lines · 0 B Paste limit 5 MB · depth 512

Result

Your loss-aware result appears here

Format, minify, inspect the tree, then copy or download without an upload.

No result yet Worker ready
Ready · content history off Processed in this browser
Indent

Save JSON

Choose the file name before downloading.

Parser modelSource before objects

Offsets, member order, duplicate names, and number text survive the first pass.

Repair policyPreview, choose, undo

No duplicate is deleted, number rounded, or ambiguous structure guessed.

PersistenceContent history off

JSON and undo state stay in this tab’s memory unless you erase them sooner.

Why loss-aware matters

What ordinary parse-and-stringify tools can hide

Converting source text directly to a JavaScript object can collapse duplicate member names and turn number lexemes into binary floating-point values. This formatter examines the source first.

Case 01Duplicate name
{
  "role": "reader",
  "role": "admin"
}

Both members are preserved and linked to their source positions. Many object-based consumers expose only one.

Warning · no automatic deletion
Case 02Risky number
{
  "id": 9007199254740993,
  "rate": 0.12345678901234567890
}

The original digits remain in formatted output. The warning explains why a binary64 consumer may not keep them.

Warning · source lexeme preserved

Verifiable local processing

Trust a behavior you can inspect

Parsing, diagnostics, repair previews, copy, and downloads run in this tab. Follow the dedicated canary procedure to verify the application boundary yourself.

Open the local-processing check →

Strict by default

JSON is not a JavaScript object literal

Helpful errors name the rule and location. Repair candidates appear only when the edit can be shown; uncertain meaning stays a manual decision.

Source featureStrict JSONRepair behavior
Trailing commaNot validRemoval proposed and selected as a safe syntax edit.
CommentNot validRemoval shown before it can be applied.
Single quoteNot validConversion requires review because escape intent can differ.
Unquoted keyNot validA simple key can be quoted only after review.
NaN, Infinity, undefinedNot validManual only. Replacing them would invent a value.
Duplicate keyValid but riskyBoth values stay; the tool never chooses a winner.

Honest limits

Bounded on purpose

5 MBrecommended pasted or typed input cap
25 MBhard local file cap before decoding
512maximum nesting depth
200diagnostics or repair candidates mounted per pass
500maximum local search or JSONPath matches
100tree children revealed in each batch

These enforced safeguards reduce accidental memory and responsiveness failures; they are not a claim that every browser or device performs identically. The tree progressively reveals wide collections instead of mounting every row at once.