Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

HTML Validator

Find broken markup and accessibility gaps in HTML, each with its line, column and a fix.

Developer No upload Works offline Free, no sign-up

A whole page or a snippet. Checked as you type; Ctrl/⌘ + Enter checks now. Nothing is rendered or uploaded.

Rules

Errors of the HTML Standard plus the accessibility basics (alt text, labels, link and button names).

Next steps

About the HTML Validator

Paste HTML or open a file and get every problem with its line and column, a plain explanation and a fix: tags that are never closed or closed in the wrong order, <div/> that does not close anything, block elements inside paragraphs or spans, duplicate IDs, attributes that do not exist (clas, aria-lable), obsolete tags such as <center> and <font>, boolean attributes such as checked="false" that still switch the feature on, and character references like &copy without their semicolon.

The checks follow the HTML Living Standard: its parse errors, the content model of every element (what may contain what), its attribute lists and its list of non-conforming features. The accessibility checks — alt text, form labels, names of links and buttons, headings, ARIA, zooming — name the WCAG 2.2 success criterion they relate to. Choose Recommended, Strict or Accessibility. Your HTML is read as text in your browser: it is never rendered, run or uploaded.

How to use it

  1. Paste HTML into the box, open an .html file, or load a sample. A whole page and a snippet both work: snippets skip the document checks (doctype, title, language).
  2. Pick a preset: Recommended for errors and the accessibility basics, Strict to add best practice, Accessibility for every accessibility check.
  3. Read the list on the right: each problem says what is wrong and how to fix it. Show selects the spot in the editor; the filters hide warnings or notes.
  4. Fix and watch the list update as you type. Copy the report, or download it as text or JSON.

Examples

A block element inside a paragraph
Input
<p>Up to 40% off <div class="tag">this week</div></p>
Result
Line 1, column 50 · </p> without an open <p>: browsers insert an empty paragraph here. Usually a block element (such as <div> or <ul>) above it closed the <p> already: a <p> may only contain phrasing content.

Browsers end the paragraph at <div>, so the </p> is left over. Use <span> inside the paragraph, or close it first.

A boolean attribute that does the opposite
Input
<input type="checkbox" id="terms" checked="false">
Result
Line 1, column 44 · checked="false" still turns checked on: a boolean attribute is on whenever it is present. Fix: remove the checked attribute to turn it off.
Misnested tags
Input
Sale ends <b><i>Sunday</b></i>.
Result
Line 1, column 23 · Misnested tags: </b> closes <b> while <i> inside it is still open. Close the inner element first (</i></b>).
An icon button without a name (Accessibility preset)
Input
<button type="submit"><svg viewBox="0 0 24 24"><path d="…"/></svg></button>
Result
Line 1, column 2 · Error (WCAG 4.1.2) · This button has no accessible name: screen readers announce just "button". Fix: give it visible text, or aria-label="…" if it only shows an icon.

Common uses

  • Finding why a layout breaks: an unclosed <div> or a <div> inside a <p> changes the page structure browsers build.
  • Checking templates, CMS output and email-to-web exports for obsolete presentational markup before publishing.
  • Reviewing a pull request: paste the rendered HTML of a component and see broken nesting, duplicate IDs and missing labels at once.
  • A first accessibility pass before a full audit: alt text, labels, link and button names, headings, zoom and autoplay.
  • Validating Vue, Alpine or htmx templates with Ignore template syntax, so framework attributes are not reported.

What is checked

Syntax — the parse errors of the HTML Standard with its own names: duplicate attributes, missing spaces between attributes, quotes inside unquoted values, unknown or unterminated character references, broken comments, <?xml … ?> and CDATA in HTML, end tags for void elements (</br>), and <div/>, which leaves the <div> open.

Nesting — elements left open (reported where something else closes them, not only at the end), stray end tags, misnested formatting tags, links inside links, buttons inside buttons, forms inside forms, headings inside headings, HTML elements that end an <svg> early, and content after </body> or between </head> and <body>.

Content models — what each element may contain and where it may be: block elements in phrasing content (also through transparent elements such as <a>), lists, definition lists, tables (order of caption, thead, tbody, tfoot), selects (including the new customizable select), <details>/<summary>, <fieldset>/<legend>, <figure>/<figcaption>, <picture>, <hgroup>, interactive content inside links and buttons, a single <main>, and metadata outside <head>.

Attributes — attributes that the element does not have (with "did you mean"), obsolete ones with their replacement, required ones (<data value>, <object data>, <bdo dir>, <optgroup label>, <link rel=preload as> …), boolean and enumerated values (type, method, dir, loading, command …), pixel values for width and height, positive numbers (size, rows, span, step), the ranges of <progress> and <meter>, input attributes that do not apply to the input type, target and sandbox keywords, IDs (unique, no spaces), references (label for, list, headers, usemap, ARIA), ARIA values, and roles.

Templates — the contents of a <template> are a tree of their own, as in browsers: an <a> or <form> inside one does not nest with one outside it, and its IDs, <main> and <title> do not clash with the page's.

The presets

  • Recommended — the errors of the HTML Standard that this checker knows (see the limitations), plus warnings for the accessibility basics (missing labels, links and buttons without a name, empty headings) and for obsolete features that still work.
  • Strict — adds best practice: language, character encoding and viewport declared, no inline style attributes or onclick handlers (a strict Content Security Policy blocks both), no javascript: links, and notes on unquoted attribute values and boolean attributes written with a value. The accessibility basics become errors.
  • Accessibility — every accessibility check, linked to its WCAG 2.2 success criterion: text alternatives (1.1.1), labels (3.3.2, 4.1.2), link purpose (2.4.4), headings (1.3.1, 2.4.6), focus order (2.4.3), audio control (1.4.2), zoom (1.4.4), timing (2.2.1), page language (3.1.1), and a <main> landmark.

Snippets, documents and templates

Markup with a doctype, <html>, <head> or <body> is checked as a whole document: doctype, a non-empty <title>, one character encoding (UTF-8), and metadata in the head. Anything else is a snippet of body content, so a component or a template partial is not told it lacks a title; elements that need a particular parent (<li>, <td>) get a warning instead of an error there.

The start and end tags that HTML lets you leave out — <html>, <head>, <body>, </p>, </li>, </td> … — are understood, so valid shorthand is not reported. Ignore template syntax skips framework attributes (v-if, :class, @click, x-data, hx-get, [prop], (event), *ngIf), {{ }} text and components with capital letters.

Limitations

  • This is an independent checker written for this page, not the W3C (Nu) validator. It follows the HTML Living Standard closely, but it does not run every rule of it — for example the full syntax of srcset, sizes, autocomplete tokens, dates and times, URLs, colours and numbers in value, the link types allowed in rel, and which ARIA roles and attributes each element may take — so a page with no problems here can still get a message from the W3C validator.
  • Microdata and RDFa attributes (itemprop, property, typeof …) are accepted, and an itemprop outside any item is reported, but the vocabularies themselves (schema.org types and properties) are not checked.
  • Only HTML is checked. CSS inside <style> and style attributes, JavaScript in <script>, and the contents of <svg> and <math> are not validated (use the CSS tools for CSS).
  • Accessibility checks can only find what the markup shows. Colour contrast, focus visibility, keyboard behaviour and whether alt text is a good description need a human (and the Color Contrast Checker). Content added by scripts after the page loads is not seen.
  • Template syntax is skipped, not understood: validate the HTML your templates produce for a complete check.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

Frequently asked questions

Is my HTML uploaded or rendered?

No. It is parsed as text in your browser and never sent anywhere, displayed as a page or run, so scripts and tracking pixels inside it do nothing. The tool also works offline once the page has loaded.

Why is <div/> an error?

In HTML (not XHTML) the slash on a normal element is ignored: <div/> opens a <div> and leaves it open, so the following content ends up inside it. Only void elements such as <br>, <img> and <input> have no end tag; the slash on them is allowed but does nothing. Inside <svg> and <math> a self-closing tag does close the element.

Why is </p> reported as a stray end tag?

A paragraph may only contain phrasing content (text and inline elements). When a block element such as <div>, <ul> or <table> starts inside it, browsers close the paragraph there, so the later </p> has nothing to close and creates an extra empty paragraph. Use <span> inside the paragraph, or end it before the block.

Are align, bgcolor and cellpadding really errors?

Yes, in web pages: the HTML Standard lists them as obsolete and says to use CSS. Browsers still apply many of them, which is why HTML email still uses some for old mail clients; this validator checks web pages, not emails.

How is this different from the W3C validator?

It runs in your browser instead of on a server, explains each problem in plain words with a fix, finds unclosed elements where they go wrong rather than only at the end, and adds accessibility checks with WCAG references. The W3C validator implements more of the detailed value syntaxes (see the limitations); for a final check of an important page, run both.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.