PocketPlay
中文

JSON Formatter

Format, minify and validate JSON with a precise error position, key sorting and a collapsible tree view.

🔒 Runs in your browser — files never leave your deviceFree · No sign-up

JSON input

0 BSize
0Lines
0Keys
0Values
0Depth

How to use the JSON formatter

  1. Paste JSON into the left box, drop a .json file on it, or press Sample — valid JSON is formatted the moment you paste.
  2. Pick an indent (2 spaces, 4 spaces or a tab), optionally sort keys A→Z, or press Minify to strip every space and newline.
  3. Switch to the Tree tab to fold large objects, then copy or download the result.

FAQ

Where exactly is my JSON broken?

The validator is a strict JSON parser written for this page, so it reports the real line and column plus the character it tripped over — trailing commas, single quotes, comments and unescaped control characters each get their own message instead of a generic "unexpected token".

Does sorting keys change my data?

No. Object keys are reordered alphabetically at every level, which JSON treats as equivalent; values, arrays and array order are untouched. Numbers keep their original text, so big integers and trailing zeros survive a round trip.

Is my JSON uploaded anywhere?

Never. Parsing, formatting and the tree view all run in your browser, so you can safely paste API responses that contain tokens or personal data.