CSS Validator
Validate CSS syntax with css-tree and inspect stylesheet details.
CSS Validator
Validate CSS syntax with the open-source css-tree parser. It catches parser errors and summarizes rules, declarations, and at-rules.
What it checks
- Broken selectors, declarations, blocks, and at-rules
- Rule and declaration counts for quick inspection
- Normalized CSS output for valid stylesheets
How to use CSS Validator
The CSS validator parses stylesheets with css-tree and reports syntax errors, rule counts, declarations, and at-rules.
Developers often use this page when they need css validator, css checker, css linter, and css syntax checker.
Privacy and data handling
This tool is designed to run in your browser for normal use, so your input does not need to be sent to a server.
- Input and output stay on the page while you work.
- Copy buttons use your browser clipboard permission when available.
- Avoid pasting private production data on shared or untrusted devices.
Examples
Check a CSS rule
Input
.card { display: grid; gap: 16px; }Output
Valid CSS
1 rules, 2 declarations, 0 at-rulesThe validator uses css-tree to parse real CSS syntax.
Steps
- 1Paste CSS into the input.
- 2Review validation results and parser errors.
- 3Copy normalized CSS if the stylesheet is valid.
Common use cases
- Check copied CSS before editing.
- Find broken selectors or declarations.
- Inspect stylesheet size and structure.
Practical tips
- A valid parse does not guarantee every browser supports a property.
- Use CSS Formatter when you only need readable output.
- Keep vendor-specific CSS under review.
FAQ
Does this use a real CSS parser?
Yes. It uses the open-source css-tree parser instead of a hand-written CSS checker.
Does it check browser compatibility?
No. It checks syntax and structure, not whether every property works in every browser.