Blogger XML Theme Security & Syntax Sanitizer
What is an HTML to XML parser?
It reads loose, forgiving HTML and rewrites it as strict, well-formed XML. A Blogger theme is an XML file, so one small mistake can stop it from saving.
Closes every tag
Turns <br> into <br/> so the parser is happy.
Quotes attributes
Adds the quotes XML always requires around attribute values.
Escapes characters
Turns a bare & or a stray < into a safe entity.
How to convert HTML to XML
Three quick steps. The result updates as you type.
Paste your code
Use the Paste button or press Ctrl + V in the input box.
Pick a tab
Choose HTML to XML, Escape, Unescape or Validate.
Copy the result
Check the status line, then copy or download the output.
Four tools in one box
Everything you need to clean code for a Blogger theme.
HTML to XML
Closes tags, quotes attributes and escapes text.
Escape
Escape characters, or wrap code in CDATA.
Unescape
Turn entities and CDATA back into HTML.
XML validator
See the exact line and column of an error.
Keeps b: and data:
Blogger tags such as b:if stay intact.
Pretty print
Indents the output so it is easy to edit.
Why Blogger needs XML-safe code
Browsers forgive messy HTML. An XML parser does not. The fix is almost always the same: escape the ampersand, close the tag, quote the attribute, or use CDATA.
Before: Blogger rejects it
<p>Tom & Jerry<br></p>
After: valid XML
<p>Tom & Jerry<br/></p>
HTML vs XML at a glance
The six rules that cause most template errors.
| Rule | HTML | XML |
|---|---|---|
| Empty tags | <br> is fine | Must be <br/> |
| Attribute quotes | Optional | Always required |
| Valueless attributes | async | async="async" |
| Ampersand | & often works | Must be & |
| Tag case | Not case sensitive | Case sensitive |
| Closing tags | Sometimes optional | Every tag closed in order |
Common Blogger XML errors
Wording can vary, but these are the messages you will meet most.
| Error message | Cause and fix |
|---|---|
| The entity name must immediately follow the '&' | A bare &. Change it to &. |
| The element type must be terminated by the matching end-tag | An unclosed tag such as <br>. Use <br/>. |
| Open quote is expected for attribute | An unquoted value. Wrap it in quotes. |
| Attribute name must be followed by the '=' character | A valueless attribute like async. Write async="async". |
| The content of elements must consist of well-formed character data or markup | A stray < in text or script. Escape it or use CDATA. |
XML entity cheat sheet
The characters you will escape most often.
&Ampersand<Less than>Greater than"Double quote'Single quote Non-breaking spaceWhen you will use it
Any time you paste code into a Blogger theme or widget.
Ad code
Add AdSense or other ad scripts to a theme safely.
Custom widgets
Paste HTML into a widget without breaking the XML.
Schema markup
Place JSON-LD inside CDATA so it passes validation.
Theme edits
Clean up snippets copied from tutorials.
Sitemaps and feeds
Check that hand-written XML is well-formed.
Learning XML
See exactly how HTML differs from XML.
Safe theme editing tips
Four habits that save you from a broken blog.
Back up first
Download your theme before every edit.
Change one thing
Small edits make errors easy to find.
Validate first
Run your snippet through the Validate tab.
Read the line number
Blogger names the line with the problem.
Your code stays on your device
The parser runs fully in your browser. The browser reads your HTML as it normally would, so tag and attribute names may be lowercased and a DOCTYPE line is dropped.
No upload
Your code is never sent, stored or read by us.
Safe for private work
Fine for client themes and private snippets.
Gone when you close
Close the tab and everything disappears.
More free BazzHood tools
Handy helpers for Blogger and SEO.
HTML to XML questions
Quick answers before you start.
What does an HTML to XML parser do?
It reads loose HTML and rewrites it as well-formed XML: every tag is closed, attributes are quoted and special characters are escaped.
Why does Blogger say my XML is not well-formed?
Blogger templates are XML files. A bare ampersand, an unclosed tag like br, an unquoted attribute or a stray less-than sign inside a script will break the template.
How do I escape HTML for Blogger?
Paste your code, choose the Escape tab and copy the result. It turns ampersands, angle brackets and quotes into XML entities, or wraps the code in CDATA.
Does it keep Blogger tags like b:if and data:post.title?
Yes. Tags with a prefix such as b:if are kept, and empty ones are written as self-closing tags. Attribute values are not changed.
Is my code uploaded?
No. Everything runs in your browser and your code never leaves your device.
What is the difference between Convert and Escape?
Convert rewrites HTML as real XML markup. Escape turns the whole code into plain text so it can sit safely inside an XML attribute or text node.
Paste. Convert. Save.
Bookmark this page so the fix is one tap away the next time Blogger rejects your code.