Skip to content

Blogger XML Theme Security & Syntax Sanitizer

HTML to XML Parser
Convert, escape and validate Blogger XML in your browser
Paste code above. The result updates as you type.

HTML to XMLEscape for BloggerXML validatorFix XML errorsCDATA wrapperEntity converterTemplate helper

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 &amp; Jerry<br/></p>

HTML vs XML at a glance

The six rules that cause most template errors.

RuleHTMLXML
Empty tags<br> is fineMust be <br/>
Attribute quotesOptionalAlways required
Valueless attributesasyncasync="async"
Ampersand& often worksMust be &amp;
Tag caseNot case sensitiveCase sensitive
Closing tagsSometimes optionalEvery tag closed in order

Common Blogger XML errors

Wording can vary, but these are the messages you will meet most.

Error messageCause and fix
The entity name must immediately follow the '&'A bare &. Change it to &amp;.
The element type must be terminated by the matching end-tagAn unclosed tag such as <br>. Use <br/>.
Open quote is expected for attributeAn unquoted value. Wrap it in quotes.
Attribute name must be followed by the '=' characterA valueless attribute like async. Write async="async".
The content of elements must consist of well-formed character data or markupA stray < in text or script. Escape it or use CDATA.

XML entity cheat sheet

The characters you will escape most often.

&&amp;Ampersand
<&lt;Less than
>&gt;Greater than
"&quot;Double quote
'&#39;Single quote
⎵&#160;Non-breaking space

When 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.

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.

Open the tool