CSS Validator
Validate your CSS code for syntax errors
Input CSS
Validation Result
CSS Validation Examples
Valid CSS has proper syntax; invalid CSS has errors. Examples:
Valid CSS
Invalid CSS – missing semicolon
The first rule is missing a semicolon after 1200px.
Paste either example into the editor above to see the validation result. Use Sample to load more data.
What Is a CSS Validator?
CSS (Cascading Style Sheets) has syntax rules. Missing semicolons, unclosed braces, invalid property names, or malformed selectors cause parse errors. A CSS validator checks whether your stylesheet is well-formed and reports errors with line and position. The W3C CSS specifications define the language.
This tool parses your CSS and reports any syntax errors. It runs entirely in your browser. Nothing is sent to a server. For formatting valid CSS, use the CSS Formatter. For minifying, use the CSS Minifier.
How to Use This Tool
Paste or Upload CSS
Copy your CSS and paste it into the left editor. You can also click Upload to load a .css file. The Sample button loads example data.
Check the Validation Result
The right panel shows Valid or Invalid. If invalid, it lists errors with line and position. Common issues include unclosed braces, missing semicolons, invalid property values, or malformed media queries.
Fix and Revalidate
Fix errors in the input and revalidate. For formatting, use the CSS Formatter. For SCSS or Less, compile first with SCSS to CSS or Less to CSS.
Common CSS Errors
Unclosed braces } or brackets ] are frequent. Missing semicolons between properties can cause cascading parse errors. Invalid property names or values (e.g., typos like dispaly instead of display) break rules. Malformed @media or @keyframes blocks also cause failures. The W3C CSS spec defines valid syntax. The W3C CSS Validator offers server-side validation for comprehensive checks.
When CSS Validation Helps
Most developers need validation when debugging styles that don't apply, integrating third-party CSS, or before deploying to production. A single syntax error can break an entire stylesheet. Running your CSS through here catches issues before they cause layout or rendering problems. Build tools like Vite or Webpack may not always report CSS errors clearly—validating here gives you precise line numbers.
It's also useful before sharing styles with teammates or submitting pull requests. For browser compatibility after validation, use the CSS Prefixer. For formatting valid CSS, use CSS Formatter. For SCSS or Less, compile first with SCSS to CSS or Less to CSS.
Frequently Asked Questions
What makes CSS invalid?
Unclosed braces or brackets, missing semicolons, invalid property names or values, malformed selectors, or syntax errors in @media or @keyframes. The validator pinpoints the issue.
Does it check browser support?
This tool validates syntax only—whether the CSS is well-formed. It does not check browser compatibility. Use Can I Use for that.
Is my data private?
Yes. Validation runs entirely in your browser. No data is sent to any server.
Does it support SCSS or Less?
This tool validates plain CSS. For SCSS or Less, compile first using SCSS to CSS or Less to CSS, then validate the output.
What about vendor prefixes?
Vendor-prefixed properties (e.g. -webkit-, -moz-) are valid. The validator accepts them. For adding prefixes automatically, use the CSS Prefixer.
Related Tools
For the CSS specification, see W3C CSS. MDN CSS is the reference. W3C CSS Validator offers server-side validation. Can I Use for browser support.