HTML validator

Validate your HTML code and detect errors, invalid tags, deprecated attributes, and structural issues. Paste HTML or upload a file to get an instant HTML validation report with warnings, semantic suggestions, and a downloadable .html output.

Supported formats: .html, .htm, .txt
Waiting for input.
No report yet
Add HTML above to generate a clean validation report with HTML5 checks, structure warnings, and best-practice suggestions.
The validated HTML will appear here with color markers for errors, warnings, and suggestions.
Red = errors, yellow = warnings, blue = suggestions.
The Copy button uses this summary.

HTML validator - Explanation & examples

The HTML validator checks your HTML code for common markup mistakes and HTML5 best-practice issues. It can detect unclosed tags, invalid elements, deprecated attributes, missing accessibility attributes such as alt or lang, and structural warnings that can hurt maintainability, accessibility, or SEO.


⭐ What does this HTML validator check?

  • Unclosed tags and unexpected closing tags
  • Improperly nested HTML elements
  • Invalid HTML elements and deprecated tags
  • Deprecated or suspicious attributes
  • Missing alt on images and missing lang on the html element
  • Missing title, missing meta charset, and semantic structure suggestions
  • Accessibility hints such as unlabeled form fields

🔎 How to use the HTML validator

  1. Paste your HTML into the input area or upload an HTML file.
  2. Leave Instant validation while typing enabled for live feedback, or click Validate HTML manually.
  3. Review the report sections for Errors, Warnings, and Suggestions.
  4. Use Copy to copy the text summary for your notes, tickets, or documentation.

⚙️ Example input

<!doctype html>
<html>
<head>
  <title></title>
</head>
<body>
  <img src="photo.jpg">
  <div>
    <p>Hello</div>
</body>
</html>

Possible report output:

Errors
- Line 8, column 5: Improperly nested closing tag </div>.
- Line 7, column 3: Tag <p> was left unclosed before </div>.

Warnings
- Line 2, column 1: Missing lang attribute on the <html> element.
- Line 6, column 3: Image is missing an alt attribute.

Suggestions
- Line 3, column 1: Missing <meta charset> declaration.

✅ Why use an HTML validator?

A reliable HTML validator helps you catch markup problems before they cause layout bugs, accessibility issues, broken parsing, or SEO weaknesses. Clean HTML is easier to maintain, easier to audit, and more predictable across browsers and devices.


⚠️ Notes and limitations

  • This tool performs client-side validation in your browser. Your HTML is not uploaded to a server.
  • The validator is designed for practical HTML checks and best-practice warnings, not full W3C specification coverage.
  • Script sections are fully ignored: content inside <script>...</script>, the <script> tags themselves, and script-tag attributes are excluded from validation.
  • Custom elements are allowed, but unusual attributes may still be flagged as suggestions for review.
  • Downloaded output is a readable HTML report, which is useful for sharing or storing review results.

Frequently Asked Questions

This HTML validator checks your markup for unclosed tags, invalid elements, deprecated attributes, accessibility gaps, and structural issues that can affect HTML quality.

You can use the HTML validator for both complete HTML documents and smaller code snippets. Full documents receive additional checks such as missing lang, title, or meta charset.

Yes. The validator reports unclosed tags, unexpected closing tags, and improperly nested elements so you can fix broken markup quickly.

Yes. The report highlights invalid HTML elements and also warns when deprecated tags such as font, center, or marquee are found in your markup.

Yes. It warns when images are missing alt attributes and when a full HTML document is missing a lang attribute on the html element.

The tool flags nesting problems, duplicate attributes, suspicious attributes, multiple h1 elements, missing main landmarks, unlabeled form fields, and tables without header cells.

No. This tool is a practical browser-based HTML validator focused on common HTML5 problems and best-practice checks. It is useful for fast markup review, but it is not a full spec-level conformance engine.

Yes. You can upload .html, .htm, or .txt files and the validator will load the content directly into the input field for checking.

Use the Copy button to copy the plain-text validation summary. You can then paste it into your notes, ticket, or documentation.

Copy copies the plain-text summary of the validation report, including the error, warning, and suggestion lists with line and column information when available.

No. All validation runs entirely in your browser. Your HTML code stays on your device and is not uploaded or stored.

Some HTML problems are not hard syntax errors but still matter for accessibility, maintainability, or SEO. Suggestions help you improve markup quality beyond basic validity.