Format and minify

I didn’t write a fancy pretty-printer. Format is JSON.parse then JSON.stringify(obj, null, 4). Four spaces because that’s the third argument I picked years ago and never added a setting. Minify is the same parse with no extra whitespace.

If parse fails, the status row under the box goes red and we leave your text alone. That’s on purpose. I hate tools that “help” by wiping a paste.

Ugly but valid

This is legal JSON. Good luck spotting postal at a glance:

{"orderId":"A-1042","shipTo":{"city":"Lisbon","postal":"1200-001"},"items":[{"sku":"WB-9","qty":2},{"sku":"LM-1","qty":1}]}

After you hit Format

Same data. Key order is whatever the browser kept (usually the order they appeared):

{
    "orderId": "A-1042",
    "shipTo": {
        "city": "Lisbon",
        "postal": "1200-001"
    },
    "items": [
        {
            "sku": "WB-9",
            "qty": 2
        },
        {
            "sku": "LM-1",
            "qty": 1
        }
    ]
}

When I minify

Request bodies, log lines, stuffing JSON into a query param I already regret. Values don’t change. stringify still does its usual Unicode escaping, which sometimes surprises people who expected raw emoji in the source.

Paste in the home page box, click Format or Minify, Copy if you need it elsewhere. Trailing commas and comments will fail parse — Auto Fix first.

There is no “2 spaces” toggle and no sort-keys. I don’t pretend otherwise.