Browser processing Input is processed on your device. Privacy & storage

JSON Formatter & Validator

Format, minify and validate JSON, with syntax highlighting, tree view and undo.

JSON editor — input and result share one box
JSON 1
Sort: Escapes: Indent: Unicode:
Search

    What this tool does

    We built this to be the best JSON tool to actually work in — not just a text box. You get syntax highlighting as you type, line numbers, a collapsible tree view for exploring large payloads, and one-click actions. Paste in your JSON: Format pretty-prints it in place with your preferred indentation. Minify strips all whitespace to reduce payload size. Validate checks the syntax and reports the exact line and column of the first error — the same messages your browser's JSON.parse produces, plus position mapping. Every action keeps the previous content one Undo away. Asc / Desc reorder the object keys of what is in the box right now — at every level, with natural ordering (item2 before item10) — while arrays keep their item order. They also keep the shape you already have: a minified payload stays on one line, an indented one keeps its own indentation.

    FAQ

    What do Escape / Unescape do?

    Escape adds escapes on top of the current content — double quotes become \" and backslashes become \\, while the line structure and indentation stay visible. Unescape reverses it, and also accepts strict single-line string literals with \n sequences. Both work in place — Undo restores the previous content.

    What do Unicode → Text / Text → Unicode do?

    Unicode → Text decodes \uXXXX escape sequences (including surrogate pairs for emoji) into readable characters. Text → Unicode encodes every non-ASCII character — e.g. Chinese — into \uXXXX escapes so payloads survive ASCII-only channels.

    How do Asc / Desc sort keys?

    They sort the object keys of the current content, at every nesting level, using natural alphabetical order — so item2 sorts before item10 and numeric keys such as 2 and 10 behave the same way. Arrays are never reordered, only key names inside objects move. The output is built from the current content and keeps its formatting: minified JSON stays minified, indented JSON keeps its own indent, and Desc reverses the previous Asc exactly.

    Is my JSON sent to a server?

    No. All parsing happens locally with the browser's native JSON parser. Input is processed locally. History is kept in this tab unless you enable saving it on this browser. Clear it using the History panel.

    What is the maximum size?

    Up to 2 MiB of JSON text and 128 nesting levels. Unsafe numbers and duplicate keys are rejected before transformations so your original input is preserved.

    Does it support JSON5 or comments?

    Standard JSON only. Remove comments and trailing commas first, or use a JSON5 tool for those dialects.