Common HTML checks — preliminary validation. This tool does not use the W3C Nu HTML Checker and does not claim complete HTML standards compliance. Everything runs in your browser; nothing is sent anywhere.
What is the HTML Validator?
The HTML Validator is a free online tool that checks your HTML for common markup problems and reports them as errors, warnings and informational notices, each with a line and column number so you can find it in your code. It catches unclosed tags, incorrect nesting, duplicate IDs, missing required attributes, invalid attribute patterns, deprecated elements and attributes, and basic semantic issues.
It is made for anyone who writes HTML: beginners learning the rules, developers debugging a page that looks wrong, and anyone doing a quick check before publishing. There is nothing to install and nothing to sign up for. Everything runs in your browser, and nothing is sent anywhere.
One honest limit: this is a heuristic, client-side checker. It is not the official W3C Nu HTML Checker, and it does not claim complete HTML standards compliance. It finds the common mistakes that cause real problems. For a full standards compliance check, run your page through the official W3C validator as well.
How to use the HTML Validator
- Paste your HTML into the box labelled “HTML input”. The tool comes with a sample page already loaded, full of typical mistakes, so you can see a report straight away.
- Click “Validate”. The tool shows a summary — how many errors, warnings and informational notices it found — and then lists each issue with its line and column number, a short description and a snippet of the code.
- Fix the errors first, then the warnings, then read the informational notices. Re-paste and validate again until the report is clean.
- Copy report copies the whole report as text, if you want to share it or work through it elsewhere. Clear input empties the box, and Reset brings back the sample.
Worked example
The sample page contains several classic mistakes:
<!DOCTYPE html>
<html>
<head>
<title>Example page</title>
</head>
<body>
<h1>Welcome</h1>
<h1>Another heading</h1>
<p>Visit <a>our site</a>.</p>
<img src="logo.png">
<font color="red">Old style</font>
<div id="main">Content</div>
<div id="main">Duplicate</div>
<div><p>Unclosed section</div>
</body>
</html>
Click “Validate” and the tool reports 9 issues: 4 errors, 3 warnings and 2 informational notices. Among them:
- A duplicate ID. Two
<div>elements both useid="main". IDs must be unique in a document — JavaScript and CSS that target#mainwill only reach the first one, and the second is unreachable by ID. - A link with no destination.
<a>our site</a>has nohrefattribute, so it is not really a link at all. It looks like one, but it goes nowhere and keyboard users cannot use it as a link. - An image with no alt text.
<img src="logo.png">has noaltattribute. Screen readers will read out the file name instead, and if the image fails to load, nothing appears in its place. - A deprecated element.
<font color="red">is an old presentational element that HTML has moved away from. Colour belongs in CSS, not in the markup. - An unclosed paragraph.
<div><p>Unclosed section</div>opens a<p>that is never closed before the</div>. The browser has to guess where the paragraph ends, and different browsers can guess differently.
Fix each one — give the second div a different ID, add an href to the link, add alt text to the image, replace <font> with a CSS class, and close the paragraph — then validate again.
Why validating your HTML matters
Browsers guess — and they guess differently
When HTML is malformed, browsers do not show an error. They silently repair it, each in its own way. An unclosed tag or a wrongly nested element can look fine in one browser and break the layout in another. Validation finds the mistakes before your visitors do, in whatever browser they happen to use.
Broken markup breaks more than the layout
A duplicate ID does not just look untidy — it breaks JavaScript that uses getElementById, and it breaks CSS that targets that ID. A missing href turns a link into plain text that keyboard users cannot activate. An image without alt text is invisible to screen readers. These are not cosmetic issues; they are functional ones, and validation is the fastest way to catch them.
Clean markup is easier to maintain
A page that validates is a page the next person can read and change without fear. Unclosed tags and deprecated elements are the kind of thing that causes a confusing bug six months later, when someone edits a nearby line and the layout shifts for no obvious reason. A quick validation pass now saves a debugging session later.
Tips for fixing what the validator finds
- Fix errors before warnings. Errors are the problems that can break rendering, scripting or accessibility — unclosed tags, duplicate IDs, missing required attributes. Warnings are worth fixing too, but they are less likely to break the page. Informational notices are things to be aware of, not necessarily to fix.
- Read the line and column number. Every issue comes with a location. Go to that line in your editor rather than hunting through the file — the mistake is usually exactly where the tool says it is, or one line above it.
- Replace deprecated elements with CSS. Old elements like
<font>,<center>and presentational attributes likebgcolorstill work in browsers, but they mix presentation into the markup. Move the styling to a stylesheet and the markup becomes cleaner and easier to change. - Make every ID unique. If you find yourself wanting the same ID twice, what you actually want is a class. IDs identify one element; classes group elements. Use a class for anything that appears more than once.
- Do not chase a perfect score at the expense of the page. This tool is a heuristic checker, not the official standard. If it flags something you understand and have a good reason for, read the note and decide for yourself. Validation is a guide, not a law.
Frequently asked questions
Is this the official W3C validator?
No. This tool runs a set of common HTML checks in your browser. It is not the W3C Nu HTML Checker and does not claim complete HTML standards compliance. It is a quick, private first pass. For a full compliance check against the standard, use the official W3C validator on your finished page.
What kinds of problems does it check for?
Unclosed tags, incorrect nesting, duplicate IDs, missing required attributes (like href on a link or alt on an image), invalid attribute patterns, deprecated elements and attributes, and basic semantic issues. Each finding is reported as an error, a warning or an informational notice, with a line and column number.
Does my code leave my browser?
No. Everything runs in your browser and nothing is sent anywhere. You can paste private or unfinished code without worrying about where it goes.
What should I fix first?
Errors first — they are the problems most likely to break rendering, scripting or accessibility. Then warnings, like deprecated elements. Informational notices are the lowest priority; read them, fix them if they apply, and move on.
Why does the same page look different in different browsers?
Because malformed HTML forces each browser to guess how to repair it, and they do not all guess the same way. An unclosed tag is the classic example: one browser may close it where you meant, another may swallow the next section into it. Validating removes the guessing.
Conclusion
Most HTML problems are small — a missing closing tag, a duplicated ID, a forgotten attribute — but small markup mistakes cause outsized trouble, because browsers repair them silently and differently. This HTML Validator finds them in seconds, tells you exactly which line they are on, and sorts them into errors, warnings and informational notices so you know what to fix first. Paste your code, work through the report, and validate again. And when your markup is clean, check the structure of the page itself with the Heading Structure Checker — it shows you whether your H1 to H6 outline actually makes sense.

