OKFree Tools
Developer

JSON Formatter & Validator

Format, minify and validate JSON, with the line and column of any syntax error

Runs locally in your browser. Nothing is uploaded.

Input

Output

Paste or type JSON to see it formatted here

How to use

  1. 1
    Paste JSON

    Paste JSON into the input. It’s validated as you type.

  2. 2
    Pick an output style

    Indent with 2 spaces, 4 spaces or tabs, or minify to one line. Sort keys when you need a stable order.

  3. 3
    Copy the result

    Click Copy above the output. If there’s a syntax error, fix it at the line and column shown.

Tips

  • Large integers lose precision

    JSON.parse turns numbers into JavaScript numbers, so integers beyond 2^53 (9007199254740992) may change. Order numbers and user IDs are the usual victims. A warning appears under the result when this happens; to keep them exact, have the API send them as strings.

  • Key order

    Keys keep their original order, except that integer-like keys such as "1" or "20" always move to the front, which is how JavaScript objects work. Duplicate keys keep only the last value.

  • Standard JSON only

    Comments, trailing commas, single quotes, NaN and undefined aren’t valid JSON and are reported as syntax errors. Clean them up when copying an object from JavaScript code.