[{"data":1,"prerenderedAt":668},["ShallowReactive",2],{"guide-html-encoding-email-newsletters":3},{"id":4,"title":5,"body":6,"date":659,"description":660,"extension":661,"meta":662,"navigation":347,"path":663,"readingTime":664,"seo":665,"stem":666,"__hash__":667},"guides\u002Fguides\u002Fhtml-encoding-email-newsletters.md","HTML Encoding for Email Newsletters",{"type":7,"value":8,"toc":641},"minimark",[9,14,18,30,34,39,42,142,146,149,268,271,275,279,285,289,295,381,384,388,398,402,474,481,485,520,524,567,571,601,605,625,629,637],[10,11,13],"h2",{"id":12},"why-html-encoding-matters-in-email","Why HTML Encoding Matters in Email",[15,16,17],"p",{},"Email clients are not browsers. They strip, reinterpret, and mangle HTML in ways web developers never expect. A character that renders perfectly in Chrome can appear as a broken symbol in Outlook or become a garbled mess in Gmail.",[15,19,20,21,25,26,29],{},"HTML encoding — converting special characters into entity references like ",[22,23,24],"code",{},"&amp;"," or ",[22,27,28],{},"&#8212;"," — ensures your content survives whichever rendering engine the recipient's client uses. If you send newsletters without attention to encoding, you are gambling with your brand's professionalism on every send.",[10,31,33],{"id":32},"characters-that-break-without-encoding","Characters That Break Without Encoding",[35,36,38],"h3",{"id":37},"the-unsafe-five","The unsafe five",[15,40,41],{},"These characters have structural meaning in HTML and must always be encoded:",[43,44,45,61],"table",{},[46,47,48],"thead",{},[49,50,51,55,58],"tr",{},[52,53,54],"th",{},"Character",[52,56,57],{},"Entity",[52,59,60],{},"Why it breaks email",[62,63,64,82,97,112,127],"tbody",{},[49,65,66,72,76],{},[67,68,69],"td",{},[22,70,71],{},"&",[67,73,74],{},[22,75,24],{},[67,77,78,79,81],{},"Starts entity references; unencoded ",[22,80,71],{}," causes parser errors",[49,83,84,89,94],{},[67,85,86],{},[22,87,88],{},"\u003C",[67,90,91],{},[22,92,93],{},"&lt;",[67,95,96],{},"Opens tags; can inject or break markup",[49,98,99,104,109],{},[67,100,101],{},[22,102,103],{},">",[67,105,106],{},[22,107,108],{},"&gt;",[67,110,111],{},"Closes tags; can truncate content",[49,113,114,119,124],{},[67,115,116],{},[22,117,118],{},"\"",[67,120,121],{},[22,122,123],{},"&quot;",[67,125,126],{},"Delimits attributes; breaks inline styles",[49,128,129,134,139],{},[67,130,131],{},[22,132,133],{},"'",[67,135,136],{},[22,137,138],{},"&apos;",[67,140,141],{},"Delimits attributes in XML-based clients",[35,143,145],{"id":144},"typography-that-vanishes","Typography that vanishes",[15,147,148],{},"Smart quotes, em dashes, and ellipses often fail in plain-text email fallbacks or older clients. Encoding them explicitly guarantees rendering:",[43,150,151,166],{},[46,152,153],{},[49,154,155,157,160,163],{},[52,156,54],{},[52,158,159],{},"Named Entity",[52,161,162],{},"Decimal",[52,164,165],{},"Typical Use",[62,167,168,185,203,227,250],{},[49,169,170,173,178,182],{},[67,171,172],{},"—",[67,174,175],{},[22,176,177],{},"&mdash;",[67,179,180],{},[22,181,28],{},[67,183,184],{},"Em dash in copy",[49,186,187,190,195,200],{},[67,188,189],{},"–",[67,191,192],{},[22,193,194],{},"&ndash;",[67,196,197],{},[22,198,199],{},"&#8211;",[67,201,202],{},"En dash in ranges",[49,204,205,207,216,224],{},[67,206,118],{},[67,208,209,212,213],{},[22,210,211],{},"&ldquo;"," \u002F ",[22,214,215],{},"&rdquo;",[67,217,218,212,221],{},[22,219,220],{},"&#8220;",[22,222,223],{},"&#8221;",[67,225,226],{},"Curly double quotes",[49,228,229,231,239,247],{},[67,230,133],{},[67,232,233,212,236],{},[22,234,235],{},"&lsquo;",[22,237,238],{},"&rsquo;",[67,240,241,212,244],{},[22,242,243],{},"&#8216;",[22,245,246],{},"&#8217;",[67,248,249],{},"Curly single quotes",[49,251,252,255,260,265],{},[67,253,254],{},"…",[67,256,257],{},[22,258,259],{},"&hellip;",[67,261,262],{},[22,263,264],{},"&#8230;",[67,266,267],{},"Ellipsis",[15,269,270],{},"Some email clients render named entities fine; others choke on obscure ones. Decimal numeric entities are the safest bet for maximum compatibility.",[10,272,274],{"id":273},"email-specific-encoding-challenges","Email-Specific Encoding Challenges",[35,276,278],{"id":277},"subject-lines-break-too","Subject lines break too",[15,280,281,282,284],{},"If your subject line contains an ampersand or emoji, encode it. Subject lines pass through SMTP headers, not just the HTML body. A bare ",[22,283,71],{}," in a subject can truncate the line or display as garbled text depending on the mailing service's encoding logic.",[35,286,288],{"id":287},"url-parameters-inside-emails","URL parameters inside emails",[15,290,291,292,294],{},"Tracking links often contain ",[22,293,71],{}," separators between query parameters. Inside an HTML email attribute, those ampersands must be encoded:",[296,297,302],"pre",{"className":298,"code":299,"language":300,"meta":301,"style":301},"language-html shiki shiki-themes github-light github-dark","\u003C!-- WRONG: bare ampersand in href -->\n\u003Ca href=\"https:\u002F\u002Fexample.com\u002Foffer?utm_source=newsletter&utm_medium=email\">Shop now\u003C\u002Fa>\n\n\u003C!-- CORRECT: encoded ampersands -->\n\u003Ca href=\"https:\u002F\u002Fexample.com\u002Foffer?utm_source=newsletter&amp;utm_medium=email\">Shop now\u003C\u002Fa>\n","html","",[22,303,304,313,342,349,355],{"__ignoreMap":301},[305,306,309],"span",{"class":307,"line":308},"line",1,[305,310,312],{"class":311},"sJ8bj","\u003C!-- WRONG: bare ampersand in href -->\n",[305,314,316,319,323,327,330,334,337,339],{"class":307,"line":315},2,[305,317,88],{"class":318},"sVt8B",[305,320,322],{"class":321},"s9eBZ","a",[305,324,326],{"class":325},"sScJk"," href",[305,328,329],{"class":318},"=",[305,331,333],{"class":332},"sZZnC","\"https:\u002F\u002Fexample.com\u002Foffer?utm_source=newsletter&utm_medium=email\"",[305,335,336],{"class":318},">Shop now\u003C\u002F",[305,338,322],{"class":321},[305,340,341],{"class":318},">\n",[305,343,345],{"class":307,"line":344},3,[305,346,348],{"emptyLinePlaceholder":347},true,"\n",[305,350,352],{"class":307,"line":351},4,[305,353,354],{"class":311},"\u003C!-- CORRECT: encoded ampersands -->\n",[305,356,358,360,362,364,366,369,372,375,377,379],{"class":307,"line":357},5,[305,359,88],{"class":318},[305,361,322],{"class":321},[305,363,326],{"class":325},[305,365,329],{"class":318},[305,367,368],{"class":332},"\"https:\u002F\u002Fexample.com\u002Foffer?utm_source=newsletter",[305,370,24],{"class":371},"sj4cs",[305,373,374],{"class":332},"utm_medium=email\"",[305,376,336],{"class":318},[305,378,322],{"class":321},[305,380,341],{"class":318},[15,382,383],{},"Most email service providers handle this automatically. If you inject raw URLs into templates yourself, encode them manually or use an HTML encoder tool.",[35,385,387],{"id":386},"microsoft-outlook-and-word-html","Microsoft Outlook and Word HTML",[15,389,390,391,393,394,397],{},"Outlook uses Word's HTML rendering engine. It supports a limited entity set and silently drops anything it does not recognize. If you use ",[22,392,138],{},", Outlook 2016 may strip it entirely — prefer ",[22,395,396],{},"&#39;"," for apostrophes in Outlook-targeted emails.",[10,399,401],{"id":400},"encoding-across-email-service-providers","Encoding Across Email Service Providers",[43,403,404,420],{},[46,405,406],{},[49,407,408,411,414,417],{},[52,409,410],{},"Provider",[52,412,413],{},"Auto-encodes output?",[52,415,416],{},"Handles named entities?",[52,418,419],{},"Notes",[62,421,422,436,449,461],{},[49,423,424,427,430,433],{},[67,425,426],{},"Mailchimp",[67,428,429],{},"Yes (mostly)",[67,431,432],{},"Yes",[67,434,435],{},"Double-encodes if you encode first — encode only raw data",[49,437,438,441,444,446],{},[67,439,440],{},"SendGrid",[67,442,443],{},"Partial",[67,445,432],{},[67,447,448],{},"Test dynamic template variables carefully",[49,450,451,454,456,458],{},[67,452,453],{},"Campaign Monitor",[67,455,432],{},[67,457,432],{},[67,459,460],{},"Template language may interfere with entities",[49,462,463,466,469,471],{},[67,464,465],{},"Postmark",[67,467,468],{},"No",[67,470,432],{},[67,472,473],{},"You must encode content yourself before sending",[15,475,476,477,480],{},"If your ESP auto-encodes, do not pre-encode your content — you will get double-encoded output like ",[22,478,479],{},"&amp;amp;"," visible to recipients.",[10,482,484],{"id":483},"practical-workflow","Practical Workflow",[486,487,488,496,502,508,514],"ol",{},[489,490,491,495],"li",{},[492,493,494],"strong",{},"Write content in plain text"," without any entity encoding",[489,497,498,501],{},[492,499,500],{},"Run it through an HTML encoder"," before pasting into your email template",[489,503,504,507],{},[492,505,506],{},"Encode URLs separately"," — ensure query parameter ampersands are encoded but the URL structure stays intact",[489,509,510,513],{},[492,511,512],{},"Test in multiple clients"," — at minimum: Gmail (web), Outlook (desktop), Apple Mail, and a mobile client",[489,515,516,519],{},[492,517,518],{},"Check the plain-text fallback"," — some clients strip entities entirely and serve plain text; make sure the content still reads well",[10,521,523],{"id":522},"common-mistakes","Common Mistakes",[525,526,527,536,542,548,561],"ul",{},[489,528,529,532,533,535],{},[492,530,531],{},"Double-encoding"," — encoding content that your ESP will encode again, producing visible ",[22,534,24],{}," in the email",[489,537,538,541],{},[492,539,540],{},"Forgetting subject lines"," — unencoded special characters in subjects get mangled in transit",[489,543,544,547],{},[492,545,546],{},"Using named entities Outlook ignores"," — stick to numeric entities for maximum safety",[489,549,550,553,554,556,557,560],{},[492,551,552],{},"Encoding image URLs"," — encoding ",[22,555,71],{}," in ",[22,558,559],{},"\u003Cimg src>"," can break image loading in some clients",[489,562,563,566],{},[492,564,565],{},"Assuming emoji works everywhere"," — emoji requires UTF-8 encoding on both the sending server and the receiving client; test before relying on it",[10,568,570],{"id":569},"key-takeaways","Key Takeaways",[525,572,573,580,589,592,595,598],{},[489,574,575,576,579],{},"Always encode the five unsafe characters (",[22,577,578],{},"& \u003C > \" '",") in email HTML bodies",[489,581,582,583,585,586,588],{},"Use numeric entities (",[22,584,28],{},") over named ones (",[22,587,177],{},") for Outlook compatibility",[489,590,591],{},"Encode query parameter ampersands in URLs but never double-encode",[489,593,594],{},"Subject lines need encoding too — do not forget them",[489,596,597],{},"Test in Outlook specifically — it drops entities it does not understand",[489,599,600],{},"Know your ESP's auto-encoding behavior to avoid double-encoding",[10,602,604],{"id":603},"related-guides","Related Guides",[525,606,607,613,619],{},[489,608,609],{},[322,610,612],{"href":611},"\u002Fguides\u002Fhtml-encoding-guide","HTML Encoding Guide",[489,614,615],{},[322,616,618],{"href":617},"\u002Fguides\u002Fhtml-entity-reference","HTML Entity Reference",[489,620,621],{},[322,622,624],{"href":623},"\u002Fguides\u002Fhtml-encoding-vs-url-encoding","HTML Encoding vs URL Encoding",[10,626,628],{"id":627},"try-it-yourself","Try It Yourself",[15,630,631,632,636],{},"Encode your newsletter content safely with our free ",[322,633,635],{"href":634},"\u002Ftools\u002Fhtml-encoder","HTML Encoder\u002FDecoder",". Paste your copy, get properly encoded output, and paste it into your email template — one click, no signup.",[638,639,640],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":301,"searchDepth":315,"depth":315,"links":642},[643,644,648,653,654,655,656,657,658],{"id":12,"depth":315,"text":13},{"id":32,"depth":315,"text":33,"children":645},[646,647],{"id":37,"depth":344,"text":38},{"id":144,"depth":344,"text":145},{"id":273,"depth":315,"text":274,"children":649},[650,651,652],{"id":277,"depth":344,"text":278},{"id":287,"depth":344,"text":288},{"id":386,"depth":344,"text":387},{"id":400,"depth":315,"text":401},{"id":483,"depth":315,"text":484},{"id":522,"depth":315,"text":523},{"id":569,"depth":315,"text":570},{"id":603,"depth":315,"text":604},{"id":627,"depth":315,"text":628},"2026-05-28","Learn how HTML encoding keeps your email newsletters rendering correctly across clients — entities, special characters, and common pitfalls.","md",{"immutable":347},"\u002Fguides\u002Fhtml-encoding-email-newsletters",6,{"title":5,"description":660},"guides\u002Fhtml-encoding-email-newsletters","UrRSdqW-324RRvjdANwIuyOjECAxI4b2_p1ZCfSpyt4",1780401334273]