Tools

Data tool

JSON formatter

Paste JSON to format, minify, validate, or sort object keys. Parsing happens locally in the browser with built-in JSON support.

Input

JSON source

Output

Processed JSON

Example cleanup

Paste a compact response such as `{"ok":true,"items":[1,2]}` and Format will produce two-space indentation without changing array order. Minify removes insignificant whitespace and returns one line, which is useful for an environment variable or a small request fixture. Both modes parse and serialize the value, so cosmetic spacing from the source is intentionally replaced.

What it checks

The formatter uses the browser's `JSON.parse`, so it rejects single-quoted property names, comments, trailing commas, missing commas, and unescaped control characters. A parser error leaves the result empty instead of returning partly repaired data. It validates JSON syntax only; it does not check required fields, value types, or an application schema.

Privacy

Parsing, formatting, and key sorting run in this browser tab. The tool does not upload, store, or send the JSON to a server. The default sample is part of the page; your replacement input remains local until you deliberately copy it or paste it into another product, where that product's policy applies.

When to sort

Sort keys alphabetizes object keys at every nesting level, while arrays keep their item order. This can make snapshots and manual comparisons easier, but it changes the source's object-key presentation and is not a semantic schema sort. Use regular Format when the pasted order is meaningful to reviewers or documentation readers.