CSS Tools

CSS Validator

Ready
CSS Input0 lines
Paste CSS and validate locally in your browser.
DiagnosticsNo report yet
Errors
0
Warnings
0
Rules
0
Declarations
0
Selectors
0
Custom Props
0
Validation Report0 lines

Stylesheet diagnostics

CSS Validator for fast, practical workflows

Use this CSS validator when you need a quick browser-side pass over a stylesheet before refactoring, converting, compiling, minifying, or opening a pull request. Paste CSS into the line-numbered editor, run validation, and review diagnostics with error and warning counts, rule totals, declaration totals, selector counts, custom-property counts, and a copyable report. The page focuses on common workflow issues such as malformed comments, unmatched braces, invalid declarations, duplicate properties, empty rules, suspicious selectors, and modern CSS patterns that deserve a second look. It is a practical CSS syntax checker, not a replacement for standards references or browser testing.

Validate locally in the browser

The checker runs with JavaScript on the page and produces diagnostics without requiring a server upload for the pasted CSS.

Read counts and reports quickly

See errors, warnings, rules, declarations, selectors, and custom properties, then copy or download a plain-text validation report.

Catch review mistakes earlier

Use warnings for duplicate declarations, empty rules, suspicious selectors, and modern CSS syntax before the stylesheet reaches review.

What this CSS diagnostics tool checks

The validator scans CSS for malformed block comments, unmatched brackets, missing selectors, trailing selector commas, suspicious question-mark selector tokens, declaration punctuation inside selectors, empty rule blocks, missing property/value colons, empty properties or values, duplicate declarations inside one rule, and possible missing semicolons between declarations.

With modern CSS warnings enabled, it also flags patterns that can need extra review, including native nesting and newer at-rules such as `@property`, `@scope`, `@layer`, and `@starting-style`. These warnings are meant to help you inspect code; they do not prove whether every browser or CSS profile accepts the stylesheet.

How to validate CSS

  1. Paste CSS into the input editor or load the sample stylesheet.
  2. Leave modern CSS warnings on when you want extra review notes for newer syntax.
  3. Select Validate CSS and read the diagnostic cards beside the editor.
  4. Check summary counts for errors, warnings, rules, declarations, selectors, and custom properties.
  5. Copy or download the report, then fix and revalidate before minifying or shipping.

Common CSS validation use cases

Check a stylesheet before opening a pull request.

Find a missing colon, semicolon, or closing brace in copied CSS.

Catch duplicate declarations that make a rule harder to review.

Remove empty rules before minifying production CSS.

Validate CSS generated from LESS, SCSS, SASS, or Stylus conversion.

Copy a report for cleanup notes during a design-system refactor.

CSS validation examples

A missing semicolon can make the next declaration look suspicious, especially when a rule has repeated properties.

.card {
  color: #e5e2e1;
  color: #d7fff3;
  padding: 1rem
  background: #131313;
}

The report helps you review duplicate declarations and likely missing separators before the issue reaches a compiled or minified file.

Suspicious selectors and empty rule blocks are easy to miss in long files.

.empty-rule {}

.bad selector ??? {
  border 1px solid red;
}

Use the diagnostic line and column details as a starting point, then confirm the fix in DevTools, MDN, or your build pipeline.

Validation scope and safety notes

This page is a local CSS diagnostics tool for common syntax and lint-style problems. It is not the same as the W3C CSS Validator, a browser engine, Stylelint, or your production build pipeline.

When a rule is disputed, check MDN, W3C references, browser DevTools, and the actual compiler used by your project. Validate before minification, after conversion or compilation, and again after fixing any reported issue.

CSS validator FAQ

What does this CSS validator check?

It checks pasted CSS for common syntax and lint-style issues, including malformed comments, unmatched braces, invalid declarations, duplicate declarations, empty rules, suspicious selectors, custom properties, and modern CSS warnings.

Does it validate CSS locally?

Yes. The validation logic runs in your browser with JavaScript and generates diagnostics, summary counts, and a report without needing to upload the pasted CSS.

Can it find duplicate declarations and empty rules?

Yes. The validator warns when the same property appears more than once in a rule and when a selector has an empty rule block.

Is this the same as the W3C CSS validator?

No. This is a browser-based CSS diagnostics tool for common workflow issues. Use W3C, MDN, browser DevTools, or your build pipeline when you need full standards or browser-engine confirmation.

Can I copy or download a validation report?

Yes. After validation, you can copy the generated report or download it as a devbruh text report for review, pull requests, or cleanup notes.

When should I validate CSS in my workflow?

Validate CSS before minifying, after converting or compiling preprocessors, before opening a pull request, and whenever a stylesheet has suspicious selector or declaration behavior.