JSON / XML Validator
Validate and format JSON and XML right in your browser. No data sent to any server.
Paste some text and press “Validate & format”.
What the JSON / XML validator does
JSON (JavaScript Object Notation) and XML (eXtensible Markup Language) are the two most common formats for exchanging structured data between systems: web APIs, config files, feeds, documents. Both are human-readable text, but a single stray comma, an unclosed bracket, or an unbalanced tag is enough to make the whole document invalid — and in production that error can be hard to spot by eye. This tool instantly checks whether what you paste is well-formed and, if it is, hands it back to you neatly indented.
For JSON, validation follows the ECMA-404 standard: the document is parsed with the browser's native parser and, on a syntax error, the tool points you to the approximate location with a line and column so you know where to look. When the JSON is valid it is reformatted with two-space indentation, laying objects and arrays out across multiple lines to make them easy to read and diff.
For XML, the tool checks that the document is well-formed: tags opened and closed correctly, proper nesting, quoted attributes, a single root element. It does not validate against a schema (XSD or DTD): it checks the shape, not the rules of a specific vocabulary. If the XML is well-formed it is re-indented with two spaces per level. All processing happens in your browser via native APIs: no document is ever sent to a server, so you can paste sensitive data without worry.
Frequently asked questions
- Is my data sent to a server?
- No. Validation and formatting happen entirely in your browser via the native JSON and DOMParser APIs. No document is transmitted or stored — you can safely paste sensitive data.
- Does the tool validate XML against an XSD or DTD schema?
- No. It checks that the XML is well-formed — balanced tags, correct nesting, a single root element — but does not check conformance to a specific schema. It is the right check for catching syntax errors in most use cases.
- Why does my JSON report a comma error?
- JSON does not allow trailing commas after the last item of an object or array, unlike JavaScript. Comments and single quotes are not allowed either: the standard requires double quotes for keys and strings.