Catch errors before they reach production
A missing comma in a JSON config, an unclosed tag in an XML feed or a tab in a YAML file can break a deployment or an integration in ways that are hard to trace. Validators parse your input with a strict parser and tell you exactly where the problem is, usually with a line and column number. This category gathers the validators for the formats developers edit every day.
Which validator do you need?
- JSON – the JSON validator checks strict JSON; the JSON5 validator accepts comments and trailing commas; the JSON fixer repairs common mistakes automatically.
- XML – the XML validator checks that documents are well-formed.
- YAML and TOML – the YAML validator and TOML validator catch indentation and syntax errors in configuration files.
- Web code – the HTML validator, CSS validator and JavaScript validator report syntax problems without running anything.
- Password hashes – the bcrypt checker and WordPress hash checker verify whether a password matches a stored hash, useful when debugging login code.
- Checkout testing – the credit card validator checks test card numbers against the Luhn checksum and network rules while you build payment forms.
Syntax, schema and semantics
It helps to know what kind of check you are running:
- Syntax – is the file parseable at all? This is what these validators check.
- Schema – does it contain the right fields and types? That needs a JSON Schema, XSD or tool-specific schema (such as the Kubernetes API) in addition to the syntax check.
- Semantics – do the values make sense? Only your application or tests can tell.
A syntax check is the fast first step: most broken configs fail there, and the error position points straight at the typo.
Reading error messages
Parsers report where they noticed a problem, which is sometimes just after the real mistake. If line 42 is reported, look at line 41 too: a missing comma or quote at the end of the previous line is a classic cause. For JSON, an "unexpected token" at the very end often means a bracket was never closed.
Validators in your workflow
Online validators are ideal for a quick check of a single file or snippet. For projects, the same checks belong in your editor (as linting) and in continuous integration, so a broken file never gets merged. When a pipeline fails with a cryptic parse error, pasting the file here usually shows the exact position much faster.
Good habits
- Validate generated files in your CI pipeline, not just by hand.
- Prefer serializers over string concatenation when producing JSON or XML.
- Keep formatting consistent with the matching formatter, which makes errors easier to spot.
- Validation runs in your browser, so configuration with internal details stays private.