Calculator
What the JSON Beautifier does
JSON Beautifier: formats Status, Output and Bytes from JSON Input, Indent and Sort keys. Example: indent 2 spaces, sort keys Keep order and action Format gives status Formatted.
The inputs are JSON Input, Indent, Sort keys and Action; the output is Status, Output and Bytes. There is no submit step; the numbers move as you adjust them.
It is mostly used by anyone cleaning up machine output. Reading raw machine output is painful; a formatted view makes the structure obvious.
Nothing is uploaded: useful when the text you are inspecting contains keys or customer records.
The field reference, the method and a worked example using the default inputs follow the tool itself.
What do the JSON Beautifier fields mean?
The JSON Beautifier uses 4 inputs. The starting figures are ordinary, not edge cases, so they make a sensible baseline.
| Field | What to enter | Default |
|---|---|---|
| JSON Input | paste or type any amount of text | [ { "name": "YoursTools", "tools": 801, "categories": ["developer", "finance", "health"], "active": true }, { "name": "Demo App", "tools": 42, "categories": ["math", "converters"], "active": false } ] |
| Indent | choose from 2 spaces, 3 spaces, 4 spaces or Tab | 2 spaces |
| Sort keys | choose from Keep order or A to Z | Keep order |
| Action | choose from Format, Validate or Minify | Format |
How does the JSON Beautifier work?
Each output is derived from the inputs above in a single pass; there is no hidden state carried between runs, so the same inputs always give the same formatted output.
Validation runs before the calculation, which is why a mistyped value shows an error rather than a plausible-looking result.
Worked example
These are the values the JSON Beautifier loads by default, and the result it produces from them. The defaults produce the result shown here; change any of them and the answer moves.
| JSON Input | [ { "name": "YoursTools", "tools": 801, "ca… |
|---|---|
| Indent | 2 spaces |
| Sort keys | Keep order |
| Action | Format |
| Status | Formatted |
|---|---|
| Output | [ { "name": "YoursTools", "tools": 801, "categories": [ "developer", "finance"… |
| Bytes | 282 |
Beautifying
Beautifying is pretty-printing with a chosen indentation. It changes only whitespace, so the parsed value is identical before and after.
| 2-space indent | the common default | compact, good for diffs |
|---|---|---|
| 4-space indent | more readable at depth | wider lines |
| Tab indent | respects reader preference | width is viewer-controlled |
Worth knowing
- Key order is preserved by most implementations but is not guaranteed by the specification. Do not build logic that depends on it.
- Deeply nested documents stay hard to read however they are indented, past four levels, consider restructuring.
- Beautifying then minifying is a lossless round trip for the data, though comments cannot survive because JSON has none.
Read next: JSON Formatting: The Rules People Get Wrong
How to use it
- Paste your content into JSON Input.
- Pick a value for Indent: the options are 2 spaces, 3 spaces, 4 spaces or Tab.
- Pick a value for Sort keys: the options are Keep order or A to Z.
- Pick a value for Action: the options are Format, Validate or Minify.
- It runs on every change, so there is no moment where the screen is out of date.
- Read Status, Output and Bytes in the results panel.
- If you need a record, Copy Link saves the inputs and Print produces a clean page.
What this tool does not do
- Processing happens in your browser, so very large inputs are bounded by available memory.
- Output follows the common convention for this format; a specific toolchain may have its own house style.
- The tool answers exactly the question it is given; it cannot know the context around your numbers.
Frequently asked questions
JSON Input, Indent, Sort keys and Action. That is the whole form. A starting value is in place for each, so the quickest approach is to replace the one number you actually care about.
With the values loaded when the page opens, status comes out as Formatted. Edit any input and that figure moves with it.
No. Disconnect from the internet and it still works; that is the simplest proof there is no server call.
No cost and no account. Use it as often as you like.
It follows the standard definition for this operation, so the result matches what a reference implementation would give.