An HTML email template is markup that has to survive software you do not control. Between your template file and the reader sit a sending tool, a receiving server and a mail client, and the template carries the content most likely to upset a parser: prices with symbols, quoted phrases, ampersands in product names, and placeholders wrapped in angle brackets. When one of those characters lands raw in the wrong place, the email does not fail loudly. It renders with a truncated link, a broken layout or a line of visible code.
The preventative step is small: encode the characters that break parsing before the template is saved. This guide shows how, using the free HTML Entity Encoder/Decoder on Ovatly, and it is honest about the limit: encoding is the safe baseline, not a guarantee that every client renders the result the same way.
Contents
- Quick answer
- Which characters in a template actually break parsing
- How to encode template text, step by step
- Worked example: one offer line, before and after
- Symbols and currencies: named or numeric
- Limitations and honest expectations
- Common mistakes
- FAQs
- Conclusion
Quick answer
Encode the five markup characters in your template text before you save the template: & becomes &, < becomes <, > becomes >, and the double and single quotes become " and '. Paste the text into the HTML Entity Encoder/Decoder, press Encode entities, and paste the result back into the template. Symbols such as currencies can be written as named or numeric entities, and the decoder side reads them back so you can check what readers see.
Which characters in a template actually break parsing
The five characters the encoder covers are the five that matter for correctness. A raw & starts an entity, so a product name containing an ampersand followed by letters can be misread. A raw < starts a tag, which is why a placeholder written as <customer_name> disappears into the parser instead of showing, and why a less-than sign in an offer line can swallow the text after it. A raw > completes stray markup. The two quote characters matter inside attribute values: a double quote inside a title or alt attribute that is itself wrapped in double quotes ends the value early, and the rest is parsed as something else.
Email templates hit all five constantly, because commercial copy is full of them. Prices bring symbols and decimals. Offers bring ampersands and quoted slogans. Merge placeholders bring angle brackets. The encoding step is not about exotic characters; it is about ordinary sales copy meeting a parser that treats its characters as instructions.
How to encode template text, step by step
- Work on the text portions of the template: the copy, the offer lines, the attribute values. Copy one piece at a time rather than the whole file, so the template's tags stay as markup.
- Open the HTML Entity Encoder/Decoder and paste the text into the input box.
- Press Encode entities to make it safe to display in HTML.
- Copy the result from the output box and paste it back into the template in place of the raw text.
- For any entity already in the template you are unsure about, paste it in and press Decode entities to read what it will show as.
Worked example: one offer line, before and after
Take a typical line of template copy, with a price, an ampersand and quoted words:
Save on Tom & Jerry's "cartoon classics" collection, now $19.99
Encoded, the line becomes:
Save on Tom & Jerry's "cartoon classics" collection, now $19.99
This follows the tool's own example, where encoding <a href="x">Tom & Jerry's</a> produces <a href="x">Tom & Jerry's</a>: the ampersand becomes &, the apostrophe becomes ', and the quotes become ". The price needs no encoding, because digits and the dollar sign are not markup characters. Pasted back into the template, the encoded line is what gets saved, and a mail client prints the original sentence, quotes and all, instead of parsing the ampersand as an entity start or the quotes as an attribute end.
Symbols and currencies: named or numeric
Prices and footers often need characters beyond the five: a copyright sign, a currency symbol next to a price. Those can be written as entities directly in the template, and the choice between forms is simple. In effect there is no difference: © and © are both the copyright sign. The numeric form works everywhere; the named form is easier to read while editing.
The decoder side of the tool is the check on this. It understands common named entities like © and , decimal entities like © and hex entities like ©, so one decode of a footer line shows you exactly the characters your readers will get. The one caution is obscurity: obscure named entities are left as they are by the decoder, and a mail client with a smaller vocabulary can do the same. For any symbol beyond the familiar few, write the numeric form and decode it once to confirm.
Limitations and honest expectations
Email clients vary widely in what they support, in parsing, entity handling and how much of HTML they honour at all. Encoding the five characters is the safe baseline: it removes the characters that break parsing, and it does not promise identical rendering everywhere. A template still needs testing in the clients your readers use.
The tool's scope is narrow and worth stating plainly. It encodes and decodes text you paste; it does not build the template, check it, or send the email. It encodes five characters, so it will not turn a copyright sign or currency symbol you paste into an entity; you write those yourself and verify them with the decoder. And encoding is not a security filter on its own, so reader-supplied text still needs escaping in the right context by the sending system. Everything runs locally in your browser, so nothing of your template leaves your machine during the check.
Common mistakes
- Encoding the whole template file. The encoder treats everything pasted into it as text to display, so a full template comes back with its tags as
<and>and renders as its own source. Encode the copy and attribute values, piece by piece, and leave the markup as markup. - Leaving quotes raw inside attribute values. A slogan in a
titleattribute or a name inalttext that contains double quotes will end the attribute early. The encoder covers both quote types, which keeps attribute contexts safe; use it on attribute text as well as body copy. - Writing placeholders that look like tags. A placeholder such as
<customer_name>is a tag to a parser, and it will not reach the reader as visible text. If a placeholder is meant to display, its brackets have to be encoded; if it is a merge field for your sending tool, follow that tool's own syntax and test the send. - Trusting an obscure named entity. A rare named entity may pass through a client or a decoder untouched and show as code in the inbox. The numeric form, decimal or hex, is the form that works everywhere.
- Skipping the decode check. An entity already in an inherited template can be wrong, doubled or obscure, and looks identical to a correct one while editing. One decode in the tool shows the characters it will produce before your readers see them.
FAQs
Which characters do I actually need to encode in an email template?
The five markup characters: &, <, >, double quote and single quote. Those are the ones that break parsing or end an attribute value early. The encoder covers exactly those five.
Should I use named or numeric entities for symbols in an email?
In effect there is no difference: © and © are both the copyright sign. The numeric form works everywhere and the named form is easier to read. For less common symbols, the numeric form is the safer habit, because obscure named entities may be left as they are.
How can I check what an entity in my template will look like to readers?
Decode it. The tool turns entities back into characters, so decoding <p> & © gives back <p> & and the copyright sign. If the decoded text reads the way you want the email to read, the encoded form is right.
Does the tool build or send the email for me? No. The tool converts text you paste, in your browser. You paste the encoded result into your template yourself, and your usual sending tool handles the rest.
Will encoded text render the same in every email client? Not necessarily. Email clients vary widely in what they support, and encoding the five markup characters is the safe baseline rather than a guarantee of identical rendering. Test the template in the clients your readers actually use.
Conclusion
Template encoding is a five-character job done at the right moment: before the template is saved, on the copy and attribute values rather than the markup. Run each piece through the HTML Entity Encoder/Decoder, decode anything inherited you are unsure about, and prefer numeric entities for symbols. When the codes themselves start showing up on a page or in an inbox, the companion guide to common HTML entity mistakes that break pages diagnoses them, and the rest of this series lives in the Developer Tools guides archive.