CSS Validator: check a stylesheet for unclosed braces, strings and comments, missing colons and missing semicolons, with the line and column of each problem.
How to Validate CSS - Step by Step Guide
Input Your CSS Code
Start with the CSS you want to check. A whole stylesheet or a single rule both work.
Automatic Syntax Check
A moment after you stop typing, the validator reads your CSS the way a browser does and looks for syntax errors. Property names and values are not checked against the spec.
Review Results & Fix Errors
Go through the list and fix each problem in the editor. If you're new to the syntax rules, web.dev's Learn CSS course explains them well.
Frequently Asked Questions
What does this CSS validator check?
It checks the structure of your stylesheet: every { has a matching }, strings, comments and url() are closed, brackets inside values are balanced, and each declaration has a property name, a colon and a value. It also flags a colon that shows up in the middle of a value, which almost always means the semicolon before the next property is missing. Every problem comes with its line and column.
Does it check property names and values?
No. A typo like colr: red or a value like width: banana passes, because the syntax is fine even though the browser will ignore it. For that kind of check, the W3C CSS Validation Service compares every property and value against the spec.
Will it complain about semicolons inside strings or data URLs?
No. Strings, comments, escapes and unquoted url(...) values are read as single pieces, the way a browser reads them, so content: "a;b}" or url(data:image/png;base64,...) don't trigger false errors. Custom properties can hold almost anything, including braces, and are left alone.
Does it understand modern CSS like nesting, @layer and calc()?
Yes, as far as syntax goes. Nested rules such as &:hover { } inside a block, @media, @supports, @layer, @container, @font-face, @keyframes, calc() and !important are all accepted. It doesn't check whether a particular browser supports a feature.
Can it fix the errors for me?
No, it only points at them. Each message says what is wrong and where, for example a { that is never closed or a missing colon, and shows the line so you can fix it in your editor. If you also want the file tidied up, the CSS Formatter on this site re-indents it without changing any values.
Is my CSS uploaded anywhere?
No. The check runs in your browser, and files you upload are read locally. Nothing is sent to a server, and nothing in your CSS is changed.
Related Tools
CSS Minifier
Minify and compress CSS code
CSS Beautifier
Beautify and format CSS code
CSS Formatter
Format and organize CSS code
CSS Fixer
Fix broken CSS automatically, repair syntax errors, missing semicolons, and malformed styles
CSS Compressor
Compress and minify CSS code
CSS Autoprefixer
Automatically add vendor prefixes for cross-browser compatibility