Skip to main content
TestrHub home
Menu

JSON Validator

Check JSON as you type, with each error explained in plain words and its exact place, then repair, format or compact it. Nothing is uploaded.

Runs in your browser. Nothing is uploaded.

Checked in your browser as you type: nothing is uploaded, saved or added to the address. Closing the page forgets it.

There is nothing to check yet.

    Structure

    The structure appears when the JSON is valid.

    Nothing is kept

    No history, no shareable link, no loading from a web address (that would go through a server): what you paste stays on this page, in your browser, until you close it.

    Results

    What this validator does

    Paste JSON, or open a file, and the validator checks it as you type. When something is wrong, it says what, in plain words, and where: the line, the column, and the place marked in an excerpt. For the most common mistakes, a Repair button fixes them and tells you exactly what it changed. Valid JSON can be formatted, compacted, sorted, copied or downloaded, and its structure explored.

    Everything happens in your browser: nothing is uploaded, saved or added to the page address, and closing the page forgets the text. That is also why the tool does not load JSON from a web address: that would go through a server.

    How to read an error

    • The explanation names the mistake, such as “There is a comma after the last item”.
    • The place gives the line and column; the excerpt shows the line with a caret (^) under the spot. “Show me” selects it in the field.
    • For a bracket or brace left open, the validator also tells where it was opened, which is usually where to look.

    The place is where the reader noticed the problem. Sometimes the real mistake is just before it, such as a missing comma at the end of the previous line.

    The JSON validator with an example containing a comma after the last item of a list: not valid JSON, the explanation in plain words, line 4 column 27, the line with a caret under the comma, and the Show me and Repair buttons.

    On the screenshot, with an example:

    1. Whether the JSON is valid, and what is wrong in plain words.
    2. Where: the line and the column.
    3. The line itself, with a caret under the spot.
    4. Repair, for the most common mistakes.

    The most common JSON mistakes

    • A comma after the last item: [1, 2, 3,] or {"a": 1,}. Allowed in JavaScript, not in JSON.
    • Single quotes: {'name': 'Ada'}. JSON only accepts double quotes.
    • Names without quotes: {name: "Ada"}. Every name needs double quotes.
    • Comments: // note or /* note */ are not part of JSON.
    • Values JSON does not know: NaN, undefined, Infinity, or Python’s True, False and None. JSON has true, false and null.
    • Numbers written differently: leading zeros (007), a plus sign, or a lone dot (.5).
    • A line break inside a text: write it as \n.
    • A missing comma or bracket, often after copying part of a larger file.

    Repair, format, compact, sort

    • Repair fixes trailing commas, comments, single quotes, unquoted names and values JSON does not allow, then lists what it changed. Check the result: replacing NaN with null, for example, keeps the JSON valid but changes its meaning.
    • Format lays the JSON out with 2 spaces, 4 spaces or tabs, one item per line.
    • Compact removes all spacing, for the smallest size.
    • Sort names A to Z orders the names in every object, which makes two JSON files easier to compare.

    Large numbers and duplicate names

    JavaScript, and many other programs, round whole numbers above 9,007,199,254,740,991. Most validators silently change such numbers when they format. This one keeps their exact digits and warns you, because the program that reads the JSON may still round them.

    The same name twice in one object is allowed by the JSON rules but usually a mistake: most programs keep only the last value. The validator lists those names.

    Frequently asked questions

    Is my JSON sent anywhere?

    No. The check, the repair and the formatting run in your browser, and nothing is kept: no history, no link.

    How large a file can it handle?

    Several megabytes work in a recent browser. The structure view shows the first 2,000 items so that the page stays responsive.

    Does it check a JSON Schema?

    Not yet: it checks that the text is valid JSON, not that it matches a schema.

    Last updated: November 5, 2026

    Guides about this test