Free tool HTML validator for the mistakes that actually break pages
Paste a page or a snippet and get a line-by-line list of the problems that most often break layouts, accessibility and SEO: unclosed and misnested tags, stray end tags, duplicate ids, missing lang, title and alt. Each finding says what the browser does with the broken markup. It is a quick first pass, not a replacement for the W3C Nu Html Checker.
- Common errors, by line
- Pages and snippets
- Runs locally
Check your HTML
Paste the full page source or just the part you are editing. Fragments skip the document checks (doctype, lang, title, charset). Results update as you type.
Up to 3 MB. Content inside <script> and <style> is not checked.
Errors
6
Broken or invalid markup.
Warnings
2
Valid in a browser, but usually a mistake.
Elements
56
Lines
58
Document checks
doctype, language, title, character encoding, viewport.
- ErrorLine 2<html> has no lang attribute. WCAG 3.1.1 (level A) requires the page language to be set so screen readers pronounce text correctly.
- OKTitle: "How to speed up your online store | Example Shop".
- OKEncoding: UTF-8.
Markup checks
In line order. Fix the first few; one unclosed tag can cause the ones after it.
- ErrorLine 16<img> logo.svg has no alt attribute. Use alt="" for decoration, otherwise describe the image.
- ErrorLine 32Stray </p>: the <p> was already closed automatically by <div> on line 32, because a <p> cannot contain a <div>. The browser turns this </p> into an extra empty paragraph.
- ErrorLine 39</b> closes <b> while <i> (line 39) is still open inside it. Close tags in reverse order: <b><i>…</i></b>.
- WarningLine 40<iframe> https://www.youtube-nocookie.com/embed/abc123 has no title. WCAG technique H64 uses the title to tell screen-reader users what the frame contains.
- ErrorLine 45</section> closes <section> while <div> (line 43) is still open inside it. Close tags in reverse order: <b><i>…</i></b>.
- ErrorLine 47id "scripts" is used again (first on line 36). ids must be unique in the page; label for, #anchors and scripts will find only the first.
- WarningLine 51<center> is obsolete in HTML. Use CSS for presentation (for <center>: text-align or margin auto).
Version v1.0Updated Update history
Which errors matter
Browsers never refuse to show broken HTML; they repair it using the rules in the HTML standard. The question is whether the repair matches what you meant. These are the findings where it usually does not.
Unclosed and misnested tags
A missing </div> can pull the footer into the sidebar; <b><i></b></i> leaves formatting running on. Fix the first one in the list first, because it often causes the ones after it.
Stray end tags
A </p> after a <div> inside a paragraph is the classic: the browser already closed the <p>, so the stray </p> becomes an extra empty paragraph and an extra gap.
Duplicate ids
<label for>, #anchor links, ARIA references and getElementById all find only the first element with an id. Common after copying a component twice.
Missing lang, title, alt
Not parse errors, but required by WCAG (lang, alt) or the standard (title), and used by search engines and translation tools.
This tool covers the frequent problems, not every rule in the standard. For a complete conformance check use the W3C Nu Html Checker, which this page does not replace. Valid HTML is not a ranking factor in itself; broken HTML matters when it hides content, breaks links or hurts accessibility.
Check markup in four steps
Good for CMS templates, email-like landing pages and snippets pasted into page builders.
-
1
Paste the HTML
A whole page (View source → copy all) or only the block you changed.
-
2
Start at the top
Findings are in line order. Fix the first unclosed or misnested tag; it often explains several later ones.
-
3
Check the document block
doctype, lang, title and charset are checked only for whole pages.
-
4
Paste again, then run the W3C checker
When this list is clean, run the full Nu Html Checker for the remaining rules.
What is checked, and against which rule
The checker parses your HTML with a small parser that follows the WHATWG HTML parsing rules for the common cases: void elements, optional end tags, raw text in script and style. It then applies the checks below.
- End tags that may be omitted (p, li, dt, dd, option, tr, td, th, thead, tbody, html, head, body) are not reported when missing; their elements close automatically, as the standard allows
- Self-closing syntax
<div/>is a parse error on non-void HTML elements but allowed inside<svg>and<math> - id must be unique, at least one character and contain no whitespace (WHATWG §3.2.6)
- Not covered: full content models of every element, attribute value syntax, ARIA rules, table structure algorithms and CSS. That is what the Nu Html Checker is for
| Markup | Finding | What the browser does |
|---|---|---|
<p>Text<div>Box</div></p> | Stray </p> | Closes <p> before <div>, then adds an empty <p> |
<b><i>Tip</b></i> | Misnested | Closes <i> early, then reopens it for the text that follows |
<div class="card">… (no </div>) | Unclosed | Everything after stays inside the card |
<div/> | Self-closing non-void | Treats it as <div> with no end |
<br></br> | End tag on void element | Treats </br> as another <br> |
| id="price" twice | Duplicate id | getElementById finds the first only |
The example page, validated
The default HTML is a 58-line store blog post. It shows fine in a browser, yet has 6 errors and 2 warnings.
| Line | Finding | Fix |
|---|---|---|
| 2 | Error: <html> without lang | <html lang="en"> |
| 16 | Error: logo <img> without alt | alt="Example Shop home" |
| 32 | Error: stray </p> after a <div> inside <p> | Close the <p> before the <div>, or use a <div> for both |
| 39 | Error: <b><i>…</b></i> misnested | <b><i>…</i></b> |
| 40 | Warning: <iframe> without title | title="Video: page speed tips" |
| 45 | Error: <div class="comment"> from line 43 not closed before </section> | Add </div> |
| 47 | Error: id "scripts" already used on line 36 | Rename one of them |
| 51 | Warning: obsolete <center> | <p style="text-align:center"> |
Paste the same HTML into the heading checker, link extractor and alt text checker to see the other problems in this page: a skipped heading level, image links with no text and a keyword-stuffed alt.
Where broken markup usually comes from
Hand-written pages are rarely the problem. Most errors come from copying, templating and editors.
Copying a component twice
Duplicate ids and doubled attributes often come from pasting the same block, form or widget twice. Make ids unique per instance.
Mixing editor HTML into templates
Rich-text editors wrap content in <p>; inserting a <div> or table inside creates stray </p> tags and empty paragraphs.
Writing XHTML habits in HTML
<div/> and <span/> are not self-closing in HTML; the element stays open and swallows what follows.
Taking "it renders" as "it is valid"
Browsers repair almost anything. The repair may still move content, break a link target or hide text from screen readers.
Catch what broken markup does to real visitors
A validator checks the code. TapCub shows the consequences on the live site: script errors, broken links and pages people abandon.
JavaScript and resource errors
Errors from real browsers with the page and number of affected sessions, from the same snippet as your analytics.
Learn more404s with their source
Broken links, including ones caused by bad markup, show up as 404 visits with the referring page.
Learn moreRage clicks
Repeated clicks on elements that do not respond, which can point to broken controls such as a button nested in a link.
Learn moreHTML validator questions
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
How do I validate my HTML online?
Paste the page source or a snippet into the box above. Errors and warnings appear with line numbers, starting from the top of the document. For a full conformance check, run the W3C Nu Html Checker afterwards.
How do I find unclosed tags in HTML?
Paste the HTML here: each element that is never closed is listed with the line it was opened on, and each end tag that closes the wrong element is reported where it happens. Elements whose end tag is optional, such as <p> and <li>, are not reported.
Is this the same as the W3C validator?
No. This tool checks the most common, most damaging problems quickly and explains them. The W3C Nu Html Checker at validator.w3.org/nu checks the full specification and is the reference; use it for a final check.
Does invalid HTML hurt SEO?
Valid HTML is not a ranking factor by itself, and almost no site is fully valid. It matters when errors change what search engines and visitors see: content swallowed by an unclosed tag, links that are not real links, or a missing title.
Why is <div/> an error?
In HTML, a trailing slash does not close non-void elements; it is ignored. <div/> opens a div that stays open, so everything after it ends up inside. Self-closing syntax is fine for void elements like <br/> and <img/>, and inside SVG.
Why does it say my </p> is stray when it is there?
A <p> cannot contain block elements like <div>, <ul> or <table>. When one appears, the browser closes the paragraph before it, so your </p> later on has nothing to close and becomes an empty paragraph.
Can it check JavaScript or CSS?
No. Content inside <script> and <style> is skipped. To shrink CSS and JavaScript, use the code minifier; for syntax checks, a linter such as ESLint or Stylelint.
Is my HTML uploaded?
No. The HTML is parsed in your browser and never sent to TapCub or to the W3C.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
See what visitors actually run into
Add TapCub to your site to catch JavaScript errors, 404s and rage clicks from real browsers.