Skip to content
DevToolPilot

Validate JSON without sending it to a server

How to read a JSON error, format a payload, and check it against a draft-07 schema while the data stays in the browser.

Start with the parser

A formatter that rewrites text with regular expressions can hide the actual mistake. DevToolPilot parses with JSON.parse. If the document is not JSON, formatting stops and the line and column of the first problem are shown.

Trailing commas, single quotes, and comments are not JSON. If a config file allows them, convert it before validating the wire payload.

Use a schema for the contract

A successful parse only means the text is JSON. The JSON Schema Validator checks required fields, types, and formats such as email. The schema on this site is draft-07. A 2020-12 keyword may fail to compile, and that failure is reported as a schema error.

Keep the document and the schema in the two editors. Error paths use JSON Pointer style locations such as /email. A slash by itself means the whole document.

Keep secrets on the machine

Tokens, customer records, and production payloads do not need to leave the browser for formatting. The tools do not write the editor contents to local storage. Clear the editor when you are done on a shared computer.

Open JSON Formatter & Validator