← All tools

JSON Formatter

Format, minify, and sort JSON locally without changing your input.

json-formatterLOCAL WORKSPACE

Switching modes keeps the original JSON and clears results. Data stays in this page’s memory: no upload, storage or URL payload. Leaving or reloading clears it. Each mode keeps its parsing limits.

Processed locally. Input limit: 1 MiB.

Formatting options

Output

Load a sample or paste JSON, then format or minify it.

Export a Python dictionary or PHP array

How to use this tool

Example
{"name":"Ada","roles":["developer","qa"],"active":true}

Load the sample and select Format JSON. With two-space indentation, each role appears on its own line. Under Formatting options, enable recursive key sorting to move "active" before "name". Minify JSON puts the result back on one line. If parsing fails, check for trailing commas and duplicate keys. Quote identifiers whose numeric precision must be preserved.

Draft TypeScript types from the same JSON →

Usage notes updated: JSON — RFC 8259 ↗

When not to use it

Do not use formatting as proof that an API response is valid or safe to trust.

Starting with a spreadsheet? Convert CSV to JSON first.