JSON Formatter, Validator & Minifier

Paste JSON to check it, pretty-print it with the indentation you prefer, or squeeze it into a single line. Mistakes are reported with the exact line and column and a plain explanation of what to fix. Everything runs in your browser, so the JSON you paste is never uploaded.

Processed locally in your browser. Your data is not uploaded to our servers.

Your JSON stays in this page: it is never uploaded or sent to analytics.

Output
SettingsDefault settings

Sorts by character code, at every level. Leave it off to keep your original key order.

Result

    The result appears here once the JSON is valid.

    Examples

    These are the most common reasons JSON is rejected, with the fix for each.

    ProblemInvalidValid
    Trailing comma after the last item{"a": 1,}{"a": 1}
    Single quotes instead of double quotes{'a': 1}{"a": 1}
    Key without quotes{a: 1}{"a": 1}
    Comment after the value{"a": 1} // note{"a": 1}
    Leading zero in a number{"n": 007}{"n": 7}

    Formula & Methodology

    A small strict parser, written for this page, reads your text character by character following the JSON standard (RFC 8259 / ECMA-404). It never runs your text as code. Formatting and minifying only change the whitespace between values.

    Notes and limitations

    • Numbers are kept exactly as you wrote them. Large integers such as 12345678901234567890 are not rounded, which JavaScriptโ€™s own JSON tools would do.
    • Keys keep their original order, even keys that look like numbers. Sorting is optional and compares character codes, so it gives the same result in every language.
    • Only standard JSON is accepted. JSON5 and JSONC extras (comments, trailing commas, single quotes, unquoted keys) are reported as errors.
    • Duplicate keys are legal in the standard, so they are reported as a note rather than an error.
    • It checks syntax only. It does not check your data against a JSON Schema.
    • Texts up to 10 million characters and 512 levels of nesting are accepted. Very large inputs depend on your deviceโ€™s memory.

    How to Use

    1. Paste your JSON into the input box, or type it.
    2. Choose Format to pretty-print it (and pick the indentation), or Minify to remove all spaces and line breaks.
    3. Read the status line. If the JSON is valid you see its statistics and the result.
    4. If it is invalid, use the line, column and explanation to find and fix the problem. The check updates as you type.
    5. Copy the result or download it as a .json file.

    Frequently Asked Questions

    Is my JSON uploaded or stored anywhere?

    No. The JSON is parsed and formatted by code running in your browser. It is not sent to ToolQuarter, to analytics or to any other service, so it is safe to paste configuration files and API responses. Avoid pasting secrets on a shared computer, as with any web page.

    Why is my JSON invalid when my program accepts it?

    Many tools and languages accept relaxed variants such as JSON5 or JSONC, which allow comments, trailing commas, single quotes and unquoted keys. This tool checks strict JSON as defined by RFC 8259, which is what APIs and most parsers require. The error message shows what to change.

    Does formatting change my data?

    No. Formatting and minifying change only whitespace. Values, numbers as written, string escapes and key order are kept. The only change you can ask for is sorting keys, which reorders the members of objects.

    What is the difference between formatting, validating and minifying?

    Validating checks the syntax. Formatting (pretty-printing) adds line breaks and indentation so people can read the JSON. Minifying removes every unnecessary space and line break to make the text as small as possible. The status line always validates, whichever output you choose.

    How large a JSON text can I use?

    Up to 10 million characters and 512 levels of nesting. Bigger texts, or very slow devices, may make the page sluggish because all the work happens on your device.

    Last updated: