json

FormatValidateConvert

Start over?

This clears both panes. Unsaved changes in either document are lost.

Replace that document?

This writes the matches into the other pane. What is there now is lost.

Load JSON from a URL

Your browser fetches it directly — the request goes to that site, never to us.

    ↑ ↓ to move · Enter to run · Esc to close

    Keyboard shortcuts

    Send feedback

    Questions, bug reports and feature requests are all welcome. A bug report is easiest to act on with the shape of the document that caused it — never send anything confidential.

    Email us

    Contact page, in a new tab, so this page stays as it is.

    Settings

    Indent

    Format and Sort keys write it, and Tab in Code view types it.

    Code text size
    14 px

    Code view and generated code.

    Wrap long lines
    Left pane opens in
    Right pane opens in

    In a new tab and after New. A view you choose in a pane is still remembered.

    JSON Validator

    On the left pane · one documentOn one document
    0
    0

    About the validator

    JSON Validator: find and fix JSON syntax errors.

    Your document never leaves the browser.

    Paste JSON into one full-width Code pane and see whether it parses, with every located problem marked in place. For constraints beyond syntax, use the JSON Schema Validator; to fix common mistakes in one press, use JSON Repair; for worked fixes, read the Repair guide; to decode the message a runtime printed, see JSON error messages; for the complete workspace, open the JSON editor.

    What makes a document valid JSON

    JSON is deliberately small. A complete document is one value: usually an object enclosed by braces or an array enclosed by brackets, but a string, number, boolean or null is legal too. Objects contain quoted property names followed by colons and values. Commas separate neighbouring members or array items, but there is no comma after the final one. Strings use double quotes and recognise a fixed set of escapes.

    RFC 8259 defines that grammar so different programs can exchange the same data. It does not include JavaScript comments, single-quoted strings, undefined, NaN, Python True or an unquoted key, even though those forms look familiar in source code. This page uses the strict JSON grammar for its Valid JSON verdict; near-JSON is identified as broken until you choose Repair.

    Read the error where it happened

    1

    Input

    {
      "name": "Ada",
    }
    2

    Reported

    Trailing comma before "}"
    Ln 2, Col 16

    The page opens in View as one full-width Code pane, the familiar shape for checking a block of text. Paste, type, open a file or load from a URL. The status bar changes among Empty, Valid JSON and Invalid JSON as the document changes. In Code, each parser diagnostic is underlined over the token that caused it; a problem at the very end reaches back to the last character so an unfinished closing bracket does not become an invisible zero-width mark.

    The parser can recover far enough to report several independent mistakes in one pass. Three bare property names can therefore produce three marked locations instead of forcing a fix-and-rerun cycle after the first. Switch to Tree, Table or Graph and the view states how many errors were found, displays whatever structure could be recovered, and suspends edits in that structural view until the source parses cleanly. Code remains the place to correct the text.

    Common mistakes and their messages

    Four mistakes

    {'id':7}
    Expected a quoted property name, found "'"
    Ln 1, Col 2
    
    {"id":7 "name":"Ada"}
    Expected "," or "}", found """
    Ln 1, Col 9
    
    {name:"Ada"}
    Expected a quoted property name, found "name"
    Ln 1, Col 2
    
    {"id":7/*note*/}
    Expected "," or "}", found "/"
    Ln 1, Col 8

    A trailing comma leaves the parser expecting another member or item before the closing brace or bracket. A single quote is not the opening of a JSON string. A missing comma makes the next key or value arrive where the previous one should already have ended, while a missing colon leaves an object name without the value separator. An unfinished string, escape, number or container is marked at the point where the input stops.

    Other failures come from borrowing another language’s literals. JavaScript undefined and NaN are not JSON values; Python None, True and False use the wrong spellings; hexadecimal numbers and a leading plus sign fall outside JSON number syntax. Comments beginning with //, /* or # also fail. The diagnostic describes the local expectation, while the underline anchors that explanation to the exact source span rather than only giving a line number.

    The usual four, fixed on one example in the Guide: Fix invalid JSON: comments, quotes and commas.

    Repair is explicit and reversible

    1

    Broken

    {"id": 7
     "name": "Ada"}
    2

    Repaired

    {"id": 7,
     "name": "Ada"}

    When the text resembles a known broken form, Repair becomes available in the editor band and pane toolbar. It can remove comments and trailing or stray commas, quote bare names and values, convert single or backtick strings, translate Python literals, correct several number forms, close unterminated strings and containers, and unwrap a JSON Markdown fence. An answer cut off mid-value can often be completed or closed without reflowing unrelated text.

    The operation is conservative. Arbitrary prose containing a brace is not treated as a document, and two fenced blocks are refused because choosing one would be a guess. No repair is hidden inside validation: you press the action, receive a summary of the categories changed, and can undo the whole rewrite once. The repaired result is parsed again before it is accepted, so a partial fix is never presented as valid merely because something changed.

    Syntax and schema answer different questions

    A syntax check knows nothing about the application that will consume the data. The object {"age":"forty"} is valid JSON even when a service requires age to be a number. So are an empty object missing mandatory fields, a status with an unexpected word, and an array where a record was expected. Passing this page means the text has a valid JSON structure, not that it matches a business contract.

    For that second question, use the separate JSON Schema Validator. It places data and a draft-07 schema side by side, marks failures on the document, and distinguishes valid from invalid, not fully checked and schema error. Keeping the tools separate makes each verdict precise: this page reports syntax without implying that a schema ran.

    Valid numbers are kept as written

    Validation does not require turning every number into a JavaScript double. The parser records the original number token, which lets the editor accept and display integers beyond the safe-integer boundary, long decimals and exponents without rounding their text. If you press Format or Minify after the document passes, those actions copy the token directly, so a syntax check followed by cleanup does not quietly change an identifier.

    There is still a strict grammar: a number cannot begin with +, have an unnecessary leading zero, end with a decimal point, or stop halfway through an exponent. Repair can correct selected familiar forms when the intention is unambiguous, but the validator itself stays an observer. That distinction keeps Valid JSON tied to the standard rather than to whatever the repair engine might infer.

    Private, offline and honest about size

    All parsing and diagnostics run in this browser tab. Opening or dropping a local file does not upload it, and the application has no backend that receives pasted text. From URL is the one action that uses the network after load: your browser requests the address directly, subject to that site’s CORS policy, and refuses a response larger than 64 MB.

    A structural view asks before parsing text above 10 MB because building its tree can hold the main thread briefly. Very large documents may also exceed the browser storage available to preserve this tab across a reload; the status bar then says not saved while leaving the open text intact. Validation itself has no server queue or account. Once loaded, the page continues checking edits offline.

    FAQ

    Frequently asked questions

    Didn’t find your answer?Write to us on the contact page →
    What does valid JSON require?

    A document must contain one JSON value: an object, array, string, number, true, false or null. Object names and string values use double quotes, members and items are separated by commas, numbers follow JSON notation, and comments or trailing commas are not part of the grammar.

    Does this validator show more than the first error?

    Yes. The position-aware parser continues after recoverable mistakes and Code view underlines every problem it can locate at once. Tree, Table and Graph report the number found, show the portion they could read and pause structural editing until the text is valid again.

    Can it repair invalid JSON automatically?

    Repair is offered as a separate action, never applied silently. It handles familiar near-JSON such as comments, trailing commas, single quotes, bare property names, Python literals, Markdown code fences and several cut-off endings. Its status message lists what changed, and one undo restores the original text.

    Is syntax validation the same as JSON Schema validation?

    No. Syntax validation asks whether the text is JSON. A schema asks whether valid JSON has the required fields, types, ranges or other rules for a particular system. Use the JSON Schema Validator when the document must satisfy that second contract.