Pretty-print, minify, sort the keys, or escape what is not ASCII. It runs in your browser: nothing is uploaded.
What it does
Paste JSON, or open a file, and choose how it is laid out: two spaces, four spaces, a tab per level, or no white space at all. The result updates as you type. Sort keys puts every object's members in order, however deep (arrays keep theirs), which makes two documents easy to compare. ASCII only writes every character outside ASCII as \uXXXX, with a surrogate pair above U+FFFF, so the text survives anything that carries only ASCII.
Numbers stay exact
Every digit of a number is kept: 9223372036854775807 stays 9223372036854775807 and 1.50 stays 1.50 (an exponent is written in its canonical form, so 1E3 becomes 1e+3). Tools that go through JavaScript's own JSON.parse turn the first into 9223372036854776000.
Your JSON stays in your tab
The formatter is the same Rust engine as the desktop app, compiled to WebAssembly and run here. Nothing is sent to a server. Several values in a row (JSON Lines) are read as one array. This page takes up to 10 MB; the desktop app formats files of any size. To query the result, use Open in Query, or the playground.
More tools
Merge several files into one, compare two documents, patch one, or validate it against a JSON Schema.
Lessons
Samples to study and to try: ▶ Try it puts them in the page.
Pretty-print and minify
Format writes a document again in the layout you pick: two or four spaces or a tab to a level, or minified, with no space at all.
A minified document, indented
Indent 2 spaces
Samples: Input
Input
{"name":"Ada","langs":["rust","sql"],"score":1.50,"address":{"city":"London","zip":"N1 9GU"}}What it gives: 12 lines
{
"name": "Ada",
"langs": [
"rust",
"sql"
],
"score": 1.50,
"address": {
"city": "London",
"zip": "N1 9GU"
}
}- Each level is two spaces in; 4 and Tab are beside 2, and Min minifies.
- Numbers are written as they were read:
1.50 stays 1.50.
An indented document, minified
Minified
Samples: Input
Input
{
"server": { "host": "0.0.0.0", "port": 8080, "tls": false },
"log": { "level": "info", "format": "text" },
"features": ["search"]
}What it gives: 1 line
{"server":{"host":"0.0.0.0","port":8080,"tls":false},"log":{"level":"info","format":"text"},"features":["search"]}- The smallest it can be: one line, no spaces between the tokens.
Sort keys and ASCII only
Sort keys puts the members of every object in order of their keys, at every depth; ASCII writes every character outside ASCII as a \u escape.
Keys in order, and only ASCII
Indent 2 spaces · Sort keys · ASCII only
Samples: Input
Input
{"zeta": 1, "city": "Zürich", "alpha": {"delta": 2, "beta": "naïve"}}What it gives: 8 lines
{
"alpha": {
"beta": "na\u00efve",
"delta": 2
},
"city": "Z\u00fcrich",
"zeta": 1
}alpha comes first, and inside it beta before delta; arrays keep their order.ü is \u00fc: the text means the same, and passes through anything that only carries ASCII.
Good to know
- Sorted keys make two documents easier to compare by eye — Diff JSON compares them whatever the order.
Your own queries, schemas, patches, documents and web addresses, kept in folders, with a sample if you like. It is the desktop app's workspace: a folder of the app opens here. This needs JavaScript.