ExtraTools/validator-html-css

PROGRAMMER TOOLS · HTML · CSS

LOCAL HTML AND CSS VALIDATOR

Check HTML and CSS with local parser engines
Utilities for code and web development.

Review HTML markup against common HTML Living Standard authoring requirements and check CSS syntax, declarations, and known property-value grammars. Paste source code or open separate local HTML and CSS files.

The HTML parser reports structural and authoring diagnostics with line and column locations. The CSS parser checks syntax and values where its grammar is available; local catalogs add cautious notes about selected HTML entries and CSS Snapshot 2026 module maturity.

Processing runs in a local browser worker. Source code is not uploaded. Parser and catalog coverage is version-dependent: this tool is not the W3C Nu Html Checker and does not prove complete standards conformance or browser support.

01 / HTML

HTML source

Paste a complete document or an HTML fragment. CSS in <style> blocks and style attributes is checked automatically; use the separate CSS field for external stylesheets. Providing both enables DOM-based static cascade analysis. Maximum: 350,000 Unicode code points combined across both editors.

02 / CSS

CSS source

Paste a stylesheet or declarations here. CSS-only checks are supported; when HTML is also provided, selectors, specificity, inheritance, and var() are resolved against its elements.

Media profile for conditional rules

Optional. Set only values you know. Supported @media conditions are evaluated against this profile; unsupported conditions are omitted from the report.

Run validation to see syntax findings and custom-property analysis.

REPORT

Validation results

Run validation to see syntax findings and custom-property analysis.

What this HTML/CSS validator checks

The tool combines local HTML and CSS parsers with static analysis of custom properties and the cascade.

  • HTML markup is checked with html-validate 11.17.0 using its standard preset and bundled HTML5 element definitions.
  • Additional local checks flag selected unsafe HTML URLs, inline event handlers, missing accessibility attributes, and obsolete catalog entries.
  • CSS syntax is parsed into an AST by CSSTree 3.2.1; known declaration values are compared with the parser’s available property grammar.
  • Custom properties beginning with -- are parsed as token streams, not matched against the ordinary property catalog.
  • The generated CSS catalog uses W3C/CSSWG specification references and MDN Browser Compatibility Data 8.1.8; browser data is compatibility evidence, not normative standards status.
  • The report shows errors and warnings with parser-reported line and column positions when available; informational findings are hidden.
  • Separate local .html/.htm and .css files can be opened; UTF-8 and Windows-1251 text are decoded in the browser.
  • var() references, nested and empty fallbacks, custom-property cycles, selector scope, specificity, inheritance, and source order are analyzed where the input provides enough context.
  • CSS-only input uses representative selector targets and unconditional :root variables. Add HTML for element-specific results; set a media profile to evaluate supported @media conditions.
  • A bare CSS declaration list is modeled on :root because it has no selector that identifies another target.

Standards, method, and limits

  1. HTML is analyzed locally with html-validate and supplemental checks based on the WHATWG HTML Living Standard.
  2. CSSTree validates syntax and values only where its own parser and lexer have a known grammar. A property absent from a curated local catalog is a cautious warning, not automatic proof that it is invalid.
  3. W3C CSS Snapshot 2026 classifies specification modules by maturity; it is not a complete property grammar or browser support profile. A module class alone does not establish an individual feature lifecycle status.
  4. The curated lifecycle and browser-compatibility catalogs are advisory. An absent or unverified catalog record is omitted; it is not a CSS syntax error.
  5. CSS is analyzed locally with CSSTree and the maintained feature catalog; browser compatibility data is not included in the conformance report.
  6. CSS in HTML <style> elements and style attributes is checked locally with CSSTree. The supplemental HTML tokenizer does not execute or insert the supplied markup into the page.
  7. With HTML, custom properties are resolved against the supplied static tree using selector matching, specificity, inheritance, importance, and source order. Dynamic pseudo-states, cascade layers, unsupported conditions, and conflicting order between separate CSS and embedded HTML sources may remain uncertain; this is not a browser computed-style engine.
  8. Without HTML, the validator performs static CSS checks and creates representative targets from selectors. :root values and selectors that can be modeled are resolved; DOM-dependent cases are omitted instead of being treated as errors.
  9. Diagnostics use parser-reported one-based line and column positions. The source is not normalized or rewritten; UTF-16 offsets are not exposed as byte positions.

WHATWG HTML Living Standard · W3C CSS Snapshot 2026

HTML and CSS source are analyzed locally. Usage tracking sends only a fixed action name and a random visitor identifier, never the source or diagnostics.

Frequently asked questions

How does this validator differ from the W3C Nu Html Checker?

It uses local versions of html-validate and CSSTree with a curated reference catalog. It is an offline check, not the Nu Html Checker service or a complete implementation of every WHATWG/W3C requirement.

What does the HTML check cover?

html-validate checks HTML with its standard preset and bundled HTML5 definitions. It reports supported structural and authoring rules, but does not guarantee conformance to every HTML Living Standard algorithm.

What does the CSS check cover?

CSSTree parses stylesheet syntax and matches values against known property grammars. Values using var() are also checked after conservative variable resolution when their context can be determined.

Do I need to enter HTML and CSS together?

Paste an external stylesheet into the separate CSS field. If styles are already embedded in HTML in a <style> element or style attribute, the HTML editor checks them automatically; no separate CSS input is needed.

Can I open files from my computer?

Yes. Open a separate .html/.htm or .css file up to 2 MB. Its contents are read and checked in your browser, not uploaded to the server.

Can it read Russian Windows-1251 files?

Yes. When opening a file, the tool tries strict UTF-8 decoding first, then Windows-1251. Pasted text remains Unicode in the browser.

What about custom HTML elements?

Names such as x-widget can be custom elements. The tool recognizes that naming form but cannot confirm that a JavaScript component is registered or works on the page.

Should I fix an unknown CSS property warning?

First check the spelling and current definitions. A property may be new, vendor-specific, or missing from the local catalog, so the warning is not a definitive standards verdict.

Does CSS Snapshot 2026 show browser support?

No. CSS Snapshot classifies specification-module maturity. Check current browser-support tables and your project targets separately.

What does the CSS 2.1 comparison show?

It classifies cataloged properties, common selectors, at-rules, and units. For example, float, clear, :hover, :focus, :before, and @media print belong to the CSS 2.1 baseline and should not be labeled obsolete. This is not a complete conformance test.

How are custom properties and var() checked?

The tool matches known HTML elements and selectors, then accounts for specificity, rule order, inheritance, nested var(), fallbacks, cycles, and CSS-wide keywords. Dynamic states such as :hover, conditional or layered branches, and unknown ordering between conflicting separate stylesheets may remain uncertain; this is static analysis, not a browser computed-style engine.

Are CSS style attributes and style elements checked?

Yes. CSS in <style> elements and style attributes is checked locally by the same CSS engine. Paste external stylesheets into the separate CSS field.

Why is an HTML 4.01 doctype reported as an error?

This tool targets the current HTML Living Standard, which expects <!doctype html>. An HTML 4.01 doctype may be valid under the historical HTML 4.01 Strict standard, but it is not the modern doctype; validating that older document requires a validator that supports its DTD.

How should I read line and column numbers?

Positions come from the parser and are one-based. Some catalog notes apply to a document as a whole and therefore have no exact location.

What is the maximum source size?

Combined HTML and CSS are limited to 200,000 Unicode code points. Each opened file may be up to 2 MB; shorten larger input before validating again.

How to use the validator

Paste HTML and CSS into their separate editors or open local files, then validate. Results appear below without reloading the page.

HTML and CSS source are analyzed locally. Usage tracking sends only a fixed action name and a random visitor identifier, never the source or diagnostics.

Could not validate the source