An array of objects
Both items become one interface. canary appears in one item, so it is optional.
[{"id": 1}, {"id": 2, "canary": true}]Paste a JSON sample. Interfaces are written beside it.
Types come from one sample. A field that is always present in the sample is required, even if your API sometimes omits it.
Ctrl+Enter or ⌘+Enter runs this tool immediately.
Waiting for input.
Parsing stays in this browser. Input is not uploaded or saved.
Both items become one interface. canary appears in one item, so it is optional.
[{"id": 1}, {"id": 2, "canary": true}]An array of strings and numbers becomes (string | number)[].
{"values": ["a", 1]}Validate JSON, then pretty-print it with 2 or 4 spaces or minify it. Invalid JSON produces an error and leaves the output empty.
Check a JSON document against a JSON Schema in the browser. Draft-07 and 2020-12 are supported, and remote $ref values are not fetched.
Check JSON syntax in the browser. Errors give a line and column, and duplicate keys that JSON.parse would silently drop are reported.