toolqik

187 · CSS

CSS Validator

Find syntax errors, unknown properties, invalid values and selectors, and typos in your CSS.

Runs in your browser

    About this tool

    Paste a stylesheet and get every problem with its line and column: broken syntax, a missing semicolon that silently swallows the next declaration, misspelled properties (with a “did you mean” suggestion), values a property doesn’t accept, invalid selectors and media queries, and at-rules in the wrong place. Click a problem to jump to it.

    Checked by a real CSS engine

    Properties, values, selectors and media queries are checked by your browser’s own CSS parser, the same code that decides whether your styles apply. So the validator knows modern CSS: nesting, :has(), container queries, oklch(), color-mix(), cascade layers and anything else your browser supports. The flip side: something new that your browser doesn’t support yet is reported as invalid, so the page says which browser did the checking.

    Why CSS errors are hard to spot

    Browsers never show CSS errors. They skip the declaration (or the whole rule, for a bad selector) and carry on, so a typo just means a style quietly doesn’t apply. Common culprits:

    • A missing semicolon: color: red followed by margin: 0; on the next line makes one invalid declaration, and both are dropped.
    • One bad selector in a list: in a:hover, a::-moz-focus-inner { … }, a browser that doesn’t know one selector ignores the whole rule.
    • Units: margin: 10 without px is invalid (only 0 may be unitless).
    • Preprocessor syntax: $variables, @include or @apply pasted into plain CSS.

    Values that use var() can only be checked when the page runs, so they’re accepted as written. Warnings point out duplicates and empty rules; tips mark things that are fine but worth a look, like fallback declarations.

    FAQ

    How do I validate CSS?

    Paste it into the box. Errors and warnings appear with line numbers as you type; click one to jump to it.

    Does it support modern CSS like nesting and :has()?

    Yes. Properties, values and selectors are checked by your browser’s CSS engine, so everything your browser supports is accepted.

    Why is a valid property reported as unknown?

    Your browser doesn’t support it yet, or it is vendor-specific. The validator says which browser did the check; try another browser to compare.

    Can it check SCSS or Less?

    No, they need compiling first. Convert SCSS with the SCSS to CSS Converter, then validate the output.

    Is my CSS uploaded?

    No. Validation runs in your browser.

    esc
    ↑↓ navigate↵ open