CSS Validator

Check CSS syntax and report common errors.

Check CSS for syntax problems such as unbalanced braces, unterminated strings or comments and malformed declarations, with line and column positions. It is meant for quick sanity checks of stylesheets or snippets, not for confirming browser support.

What is CSS syntax validation?

CSS syntax validation checks that stylesheet text can be tokenized and parsed: rules have selectors and balanced curly braces, declarations are written as property: value, and strings and comments are closed. Browsers are forgiving and silently skip what they do not understand, so a typo can make a rule disappear without any visible error. This tool combines a bracket and string scanner with the css-tree parser and merges their findings, removing duplicates and sorting by position. It checks syntax only: it does not tell you whether a property name exists, whether a value is valid for it, or whether a browser supports a feature.

How to use CSS Validator

  1. Enter CSS Type or paste into the CSS editor, or load a .css file.
  2. Validate Press Validate CSS.
  3. Read the result A green message means the syntax looks valid; otherwise the summary and a list of Line and col entries are shown.
  4. Fix and repeat Edit the code and validate again; the previous result is cleared when you edit.

Frequently asked questions

Does it check property names?

No. It checks structure and syntax, not whether a property or value exists or is supported by browsers.

Is my CSS sent anywhere?

No. Parsing is done locally with the css-tree library on the page.

Why do I get several errors for one mistake?

A single missing brace or colon can confuse the parser for what follows. Fix the first one and validate again.

Can I validate SCSS or Less?

No. Only plain CSS syntax is checked, so preprocessor features may be flagged.

Why is the Validate button disabled?

It stays disabled until the editor contains non-whitespace text.