An HTML fixer takes broken HTML and gives you back a repaired version: tags that were never closed get their
closing tag, stray closing tags disappear, wrongly nested tags are put in the right order, attribute values get
proper quotes and a bare < in your text is escaped. You paste the broken code on the left, click
Fix HTML and the fixed code shows up on the right.
Here’s the neat part: browsers are already very good at reading broken HTML. They have to be, because half the
web is broken. This tool asks your browser’s own HTML parser to read your code, then writes down what it
understood as clean, indented HTML. So the fixed code matches how browsers already see your page, with no
guessing and no AI. Everything runs in your browser and your code is never uploaded.
Some mistakes can’t be fixed by a machine, because only you know what you meant. A duplicate id or a missing
alt text needs a human. The tool is honest about that: it lists those under Still to fix by hand,
right next to what it fixed.
Five short steps. Paste the examples into the tool above, click Fix HTML and see what happens.
Step 1 Paste or Open Your Broken HTML
Get your code into the left panel. Pick whichever is easiest:
- Paste it: copy HTML from your editor, a CMS, an old template or an email, and paste it in.
- Open a file: click the upload button, or drag an .html file onto the tool.
- Click Sample: loads a small page with a bunch of typical mistakes, so you can see the fixer at work.
Then click the green Fix HTML button under your code (or press Ctrl+Enter).
Nothing changes on the right until you do. If you edit your code afterwards, click Fix again.
Try it: unclosed tags get closed
Before:
<ul>
<li>Coffee
<li>Tea
</ul>
<p>Only <strong>$3 a cup</p>
After:
<ul>
<li>Coffee </li>
<li>Tea </li>
</ul>
<p>Only <strong>$3 a cup</strong></p>
💡 Notice the </strong> landed right before </p>. Left alone, a browser
would carry the bold into every paragraph after it. The fixer closes it where the paragraph ends.
Step 2 Check the “Fixed Automatically” List
Under the fixed code you’ll see a one-line summary, and the Summary tab has the full report.
Fixed automatically lists every problem the
tool found in your HTML, with its line number and what was done about it. Click a row to select that line in
your original code, so you can see exactly what was wrong.
Try it: wrong nesting and a stray closing tag
Before:
<p><b><i>Hot deal!</b></i></p>
<div>Ends Friday</div></span>
After:
<p><b><i>Hot deal!</i></b></p>
<div>Ends Friday</div>
💡 Tags close in the reverse order they opened: last in, first out. <b><i> closes as
</i></b>. The lonely </span> had no opening tag, so it’s gone.
Step 3 Let It Clean Up Quotes, Case and Special Characters
The small stuff gets fixed too. Tag and attribute names become lowercase, every attribute value gets double
quotes, and characters that could be mistaken for markup, like a bare < or
&, are written as entities (<, &).
Try it: an old-school link and a “less than” sign
Before:
<A HREF=/menu class='link'>Menu</A>
<p>Kids < 5 eat free</p>
After:
<a href="/menu" class="link">Menu</a>
<p>Kids < 5 eat free</p>
Step 4 Full Page or Snippet? It Can Tell
If your code has a doctype or an <html>, <head> or
<body> tag, it’s fixed as a full page: you get <!DOCTYPE html> at the
top and the complete structure every page needs. Anything else is treated as a snippet, so a single
<div> stays a single <div>, ready to paste back into your template.
Try it: a page with missing pieces
Before:
<title>Pixel Bakery</title>
<body>
<h1>Hello!</h1>
After:
<!DOCTYPE html>
<html>
<head>
<title>Pixel Bakery</title>
</head>
<body>
<h1>Hello!</h1>
</body>
</html>
💡 The report will still ask you to add lang="en" to <html>. The fixer can’t
know which language your page is in, so that one is up to you.
Step 5 Fix the Rest by Hand, Then Preview and Copy
Still to fix by hand lists what the parser can’t decide for you, with line numbers in the
fixed code. Click a row to jump to it. The usual suspects: an image without alt text, the same id used twice,
a missing <title>.
Try it: two things only you can decide
Fixer output (2 left to fix):
<img src="logo.png">
<p id="intro">Welcome!</p>
<p id="intro">Fresh bread daily.</p>
After your edit (0 left):
<img src="logo.png" alt="Pixel Bakery logo">
<p id="intro">Welcome!</p>
<p id="hours">Fresh bread daily.</p>
- Preview: switch the output to Preview to see the fixed page rendered. Scripts stay off unless you tick JavaScript.
- Copy: puts the fixed HTML on your clipboard in one click.
- Download: saves it as an .html file.
- Next step: run the result through the HTML Validator for a
final check, or keep working on it in the HTML Editor.
💡 Always give the fixed code a quick look before you ship it. When a closing tag is missing, the fixer closes
the element where the browser would, which is usually, but not always, where you meant it to end.
How does the HTML fixer work?
It uses the HTML parser that’s built into your browser, the same one that reads every web page you visit. That parser already knows how to deal with broken markup: it closes tags you forgot, drops stray closing tags and untangles wrong nesting. The fixer lets it read your HTML, writes the result back out as clean code and indents it. No AI and no server are involved, so the same input always gives the same output.
Will fixing change how my page looks?
Almost never. The fixed code is how browsers already read your HTML, just written out properly, so the page renders the same. There is one deliberate exception: if a <b>, <i>, <a> or similar tag is left open inside a paragraph or list item, the fixer closes it where that block ends. Browsers would carry the bold or the link into the following paragraphs, which is almost never what you meant.
What can’t it fix?
Anything where it would have to guess what you meant. A duplicate id, an image without alt text, a missing <title> or lang attribute, an empty src and obsolete tags like <center> all need a human decision. The tool lists them under “Still to fix by hand”, with the line number in the fixed code. Click one to jump to it.
Why did it add <html>, <head> and <body>?
Only because your code looked like a full page: it had a doctype or an <html>, <head> or <body> tag. A full page gets the complete structure every page needs, with <!DOCTYPE html> at the top. A snippet, like a single <div> or a few paragraphs, is fixed as a snippet and nothing is wrapped around it.
Why did © turn into ©?
The parser turns entities into the real characters, so © becomes © and é becomes é. The page looks exactly the same, as long as it is saved as UTF-8 with <meta charset="utf-8"> in the <head> (the Download button saves UTF-8). The entities that matter for the markup, &, <, > and , stay as they are.
What is the difference between the fixer, the validator and the formatter?
The HTML Validator finds problems and explains them, but leaves your code alone. The HTML Fixer repairs what can be repaired safely and tells you what’s left. The HTML Formatter only changes spacing and indentation. A good routine: fix, then check the “Still to fix by hand” list, then run the result through the validator once more before you ship it.
Is my HTML uploaded anywhere?
No. The fixing, the checks and the preview all happen right here in your browser, so your code never leaves your computer. The preview runs in a locked-down frame and scripts in it stay off unless you tick JavaScript.
Does it fix my CSS and JavaScript?
No. The code inside <style> and <script> is only re-indented, never changed. The fixer works on the HTML tags around it. If a script or style block is broken, your browser’s developer tools (F12) will point at the exact line.