Code · Made a little simpler

HTML Broken Tag Fixer

Serialize the tree that an HTML parser builds from malformed source. Compare the exact changed range, review parser diagnostics and save the resulting HTML.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Serializes the repaired HTML parser tree. Review changes to nesting, implied elements, entities and formatting before using the output.

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

HTML Broken Tag Fixer: how to use it

  1. Paste HTML or open a local file. Choose Complete document or Fragment and the fragment’s parent context.
  2. Select Repair HTML. Inspect parser diagnostics, the serialized source and the Before and After change.
  3. Review recovered nesting and any dropped content. Download the repaired text, or download a JSON diff to apply the shown replacement.

Limits and notes

Accepts up to 250,000 UTF-16 code units of saved HTML. Serialization can normalize quotes and entities, expand optional tags and rearrange markup. The parser cannot infer your intended nesting. The resulting HTML may retain executable markup and is displayed as text.

How your privacy works →

HTML Broken Tag Fixer: common questions

Why did the tool add closing li tags?

The serializer writes list item end tags even when the HTML syntax permits omitting them. A source change alone does not prove the input was invalid.

What context should I use for a single table row?

Choose Fragment with a tbody context for tr markup. Match the surrounding parent element to the place where you will put the fragment.

How do I apply the exported diff?

In the original input, replace the text between startOffset and endOffset with after. Offsets start at zero and count UTF-16 code units, and endOffset is exclusive.

Guides