HTML Validator - Find Unclosed Tags and Broken Nesting
Paste a page, a template or an email snippet and this checker reads it the way a browser does. It stops at the first real mistake and tells you the line and column: an unclosed tag, comment or attribute quote, a closing tag that does not match, a stray closing tag, a duplicate id, or nesting the browser would rearrange behind your back. Valid HTML5 shortcuts - void elements without a slash, optional end tags, unquoted attributes, custom elements and SVG - are accepted as they are.
What it reports
- Tags, comments, attribute quotes and script/style/textarea/title blocks that are never closed
- Closing tags that do not match the open element, or have nothing to close
- Elements still open at the end of the document
- Links inside links, nested headings, nested forms or buttons, and div-style self-closing tags
- Duplicate id values and attributes repeated inside one tag
- Images without alt text (as a warning)
The check runs in your browser and your markup is never rendered on the page. It does not test content models or attribute values; for that, use the W3C Nu HTML Checker.
How to Validate HTML - Step by Step Guide
Input Your HTML Document
Start by entering your HTML document into the validator. Whether you're validating code from our HTML editor or Word to HTML converter, you can paste content, upload files, or use sample data.
Example: Valid HTML Document
Here's a well-formed HTML5 document that will pass validation:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>My Page</title> </head> <body> <h1>Hello World</h1> </body> </html>
Review Validation Results
A moment after you stop typing, the validator shows the first problem with its line and column - or, if there is none, the document statistics and any missing alt text. After validation, use our HTML beautifier to format the code properly.
Common HTML Issues Detected:
❌ Unclosed tags: Missing closing tags for elements
<div><p>Text</div> // Missing </p>⚠Missing alt attributes: Images without alt text for accessibility
<img src="photo.jpg"> // Should have alt="..."❌ Paragraph around a block: the browser ends the <p> at the <div>, so the </p> is left with nothing to close
<p><div>Text</div></p> // Use <div> instead of <p>Fix Issues and Download
If validation errors or warnings are found, use the detailed feedback to fix issues. Once validated, you can convert to PDF, minify for production, tidy it with the HTML Formatter, preview it in the HTML viewer, or download your HTML document.
Frequently Asked Questions
What does this HTML validator check?
It reads your markup the way a browser does and stops at the first real problem: a tag, comment, attribute quote or <script>/<style>/<textarea>/<title> block that is never closed, a closing tag that does not match what is open, a closing tag with nothing to close, an element left open at the end, the same id used twice, an attribute repeated inside one tag, and nesting the browser would quietly repair - an <a> inside another <a>, nested headings, <div/> written as if it closed itself, or a </p> after a block element has already ended the paragraph. Each problem comes with its line and column.
Will it complain about normal HTML5 shortcuts?
No. Void elements like <br>, <img> and <input> without a slash are fine, and so are left-out end tags that HTML allows (</li>, </p>, </td>, </tr>, </option> and friends), unquoted attribute values, boolean attributes like disabled or checked, custom elements such as <my-widget>, and self-closing <path/> or <circle/> inside SVG.
What does it not check?
It does not know which elements are allowed inside which (a <div> inside a <span>, say), whether attribute names and values are valid, or anything about CSS and JavaScript. For that kind of full standards check, run your page through the W3C Nu HTML Checker at validator.w3.org/nu. This page is the quick first pass that catches the mistakes which actually change how the page is built.
Why does it say my </p> has nothing to close?
A paragraph cannot contain block elements such as <div>, <ul> or <table>. When the browser meets one inside a <p>, it ends the paragraph right there, so the </p> you wrote later has no open paragraph left. Swap the <p> for a <div>, or move the block element out of the paragraph.
What are the warnings under the statistics?
They are hints, not errors. At the moment the only one is an <img> without an alt attribute: screen readers need it, and alt="" is the right value for purely decorative images.
Is my HTML sent to a server?
No. The check runs in your browser and nothing you paste or upload leaves your computer. Your markup is also never rendered on this page, so scripts inside it do not run.
Can it fix the errors for me?
No, it only points at them. Once the markup is clean, the HTML Formatter can tidy the indentation and the HTML Viewer shows how the page renders.
Related Tools
HTML Viewer
View and preview HTML code online with safe rendering and structure analysis
HTML to Table
Extract and convert HTML tables to structured data with Excel export
HTML Fixer
Fix broken HTML automatically, repair unclosed tags, mismatched elements, and syntax errors
HTML Formatter
Format and beautify HTML code with proper indentation and syntax highlighting
HTML to PDF
Convert HTML documents to PDF with preserved styling, images, and formatting
PDF to HTML
Convert PDF documents to clean HTML code with preserved formatting and structure