Free online tools to generate, calculate,
convert, format, encode, and play.
 

CSS Validator

Validate CSS code for syntax errors, unclosed rules, invalid selectors, and structural issues with detailed error reporting and statistics.

Drop a .css file here or
Valid CSS Unclosed brace Bad selector Missing semicolon Media query

How It Works

This tool parses your CSS and checks for structural and syntax errors. It validates brace matching, selector syntax, property declarations, at-rule structure, and common mistakes. All processing happens entirely in your browser — no data is sent to any server.

What Gets Checked
  • Matching curly braces { }
  • Valid selector syntax (no empty selectors, proper combinators)
  • Property declarations end with semicolons
  • No empty rule blocks
  • Matching parentheses and brackets
  • Proper at-rule structure (@media, @keyframes, etc.)
  • Unclosed strings and comments
  • Common typos and invalid patterns
CSS Syntax Rules
  • Selectors are followed by a declaration block: selector { ... }
  • Declarations use the form: property: value;
  • Each declaration ends with a semicolon
  • At-rules start with @: @media, @import, @keyframes
  • Comments use /* ... */ syntax
  • Strings use single or double quotes
Common Errors
ErrorExampleFix
Unclosed brace.box { color: red;.box { color: red; }
Missing semicoloncolor: red
font-size: 14px
color: red;
font-size: 14px;
Empty selector{ color: red; }p { color: red; }
Unclosed comment/* comment/* comment */
Unclosed stringcontent: "hello;content: "hello";
Tip: Need to format or beautify your CSS? Try the CSS Formatter for pretty-printing and minification.

Embed This Util

You can embed this util on your own site as a widget. Adding ?embed=1 to the URL loads a compact version with just the tool itself; no header, menu, or documentation. Paste this snippet into your HTML:


    

Copy snippet Adjust the height to taste.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with