100% client-side — files never leave your device

JSON formatter and validator

Format hard-to-read JSON, validate syntax, minify payloads and sort object keys. See structure statistics, then copy or download the result — all in your browser.

Drop a JSON file, or click to browseYou can also paste JSON directly below.

    How it works

    1. Paste or open JSON. Large payloads stay local instead of being posted to a formatting service.
    2. Format or minify. Choose two spaces, four spaces or tabs; optionally sort object keys recursively.
    3. Fix precise errors. Invalid input reports the parser message and, when available, its line and column.

    Formatting is not validation by itself

    A formatter must parse the entire document before it can print it again. That means a successful result is also valid JSON — matching quotes, legal commas, one top-level value and no JavaScript-only syntax such as comments.

    Use minified JSON for transfer, formatted JSON for review

    Whitespace has no semantic meaning in JSON. Keep readable formatting in source control and minify only when payload size matters. The JSON validation guide covers the errors people hit most often.

    Frequently asked questions

    Does this validator send JSON to a server?

    No. Parsing, formatting and sorting run in your browser, so API payloads and configuration files stay on your device.

    Can it tell me where JSON is invalid?

    When the browser reports an input position, the tool converts it to a line and column so the broken comma, quote or bracket is easier to find.

    Does sorting keys change arrays?

    No. Object keys are sorted recursively, but array item order is preserved because that order can carry meaning.

    What do the structure statistics report?

    After a successful parse the summary line counts objects, arrays and keys and reports the maximum nesting depth — a quick way to see that a payload is deeper or wider than you expected.

    Can reformatting change my data?

    It can, in two known cases: duplicate keys in the same object collapse to the last occurrence, and integers beyond 2^53 or very long decimals are rewritten as the nearest double. The document is parsed into real values and printed again, which is what makes validation possible — but if such values must survive byte-for-byte, edit the text by hand instead.

    Related tools