Format or validate JSON

Paste JSON and see it formatted and colour-coded as you type. Mistakes are pinned to their line, and the usual ones are fixed in one click.

Drop your file here

or click to browse

All files • or paste with ⌘V
Nothing has left this page since you opened the tool. Show network activity

    The browser enforces this: the site’s security policy only lets the page talk to the code libraries’ servers and an anonymous usage counter (tool name, file type, size range). A request carrying your file to anywhere else would be blocked before it left.

    Check it yourself: open your browser’s developer tools, go to the Network tab, and run the tool. Or turn off Wi-Fi once the tool has loaded; it keeps working.

    How it works

    Paste JSON and see it formatted and colour-coded as you type. Mistakes are pinned to their line, and the usual ones are fixed in one click.

    Paste JSON, or drop a .json file anywhere on the page, and the formatted version appears beside it as you type: 2 spaces, 4 spaces, tabs, or minified to one line, with keys sorted A to Z if you want. Switch to the tree view to fold any object or list, peek inside folded ones, and click a key to copy its path, such as $.items[3].price. When the JSON is broken, the tool names the problem in plain words, highlights the line and shows the spot, so you can jump straight to it. The mistakes people make most (trailing commas, comments, single quotes, keys without quotes, Python's True and None, missing commas) are fixed in one click, and you can undo the fix. Unlike most formatters, numbers and key order come out exactly as they went in: a long ID like 9007199254740993 is not rounded, 1.50 stays 1.50, and a key named "2" is not moved to the top. It also warns about duplicate keys, and unwraps JSON that arrived inside a string, as it often does in logs. Everything runs in your browser; your JSON is never uploaded.

    How to use it

    1. Paste or drop your JSON. It is formatted and checked as you type.
    2. Fix anything flagged. Jump to the line, or press Fix and format for the usual mistakes.
    3. Choose the shape. 2 spaces, 4 spaces, tabs or minified, sorted or not; browse it as a tree.
    4. Copy or download. Copy the result or save it as a .json file.

    Frequently asked questions

    Why does my JSON show as invalid?
    The tool names the problem, highlights the line and points to the column. The usual causes are trailing commas, comments, single quotes and keys without quotes; those are fixed with one click on Fix and format.
    Can I sort keys?
    Yes. Turn on Sort keys and every object's keys are put in A to Z order. Turn it off and the original order is kept exactly.
    Will big numbers or IDs change?
    No. Many formatters round integers above 9,007,199,254,740,991 and drop trailing zeros. This one keeps every number exactly as written.
    How do I get the path to a value?
    Open the Tree view and click any key or list index. Its path, such as $.customer.email, is copied.
    Is my JSON uploaded?
    No. Formatting happens in your browser and nothing is sent anywhere.
    Saved