General2026-07-21

HTML Entities Saved My Blog From Breaking

A single angle bracket in a blog post about C++ took down my entire page layout. That is the day I learned HTML entities are not optional — they are essential.

I remember the exact moment my blog broke. I had written a post about C++ templates, and in it I used the actual angle brackets from the code — \x60\x60 and \x60\x60. I hit publish, and suddenly half my page was gone. The browser had interpreted my carefully written code examples as HTML tags. Everything after the first \x60\x60 was either invisible or wrapped in formatting I never asked for. That was the day I learned about HTML entities, and I was embarrassingly late to the party. HTML entities are special codes that let you display reserved characters — the ones that HTML uses for its own syntax — without the browser trying to interpret them. The most important ones are \x60<\x60 for the less-than sign \x60<\x60, \x60>\x60 for the greater-than sign \x60>\x60, and \x60&\x60 for the ampersand \x60&\x60 itself. These three would have saved my C++ blog post completely. But there are so many more. And I use them constantly now. The non-breaking space \x60 \x60 is the one I reach for most. It prevents two words from splitting across lines. I use it between numbers and their units, between names and initials, and anywhere an awkward line break would look unprofessional. It is a tiny tweak that makes text feel polished. Copyright and trademark symbols — \x60©\x60, \x60®\x60, \x60™\x60 — look much cleaner than trying to type the actual character, especially since some fonts render those symbols inconsistently. Similarly, \x60—\x60 for em dashes and \x60–\x60 for en dashes are far more reliable than typing hyphens and hoping for the best. Once you start using real em dashes, hyphens start to look wrong. Curly quotes are another one. \x60“\x60 and \x60”\x60 for double quotes, \x60‘\x60 and \x60’\x60 for single quotes. They give your text proper typographic quotation marks instead of the straight up-and-down marks that look like they belong in a terminal window. It is a subtle difference, but it adds up across an entire article. The fraction entities like \x60¼\x60, \x60½\x60, and \x60¾\x60 are lifesavers for any content that deals with measurements or recipes. And the arrow entities — \x60→\x60 for right arrow, \x60←\x60 for left arrow — are great for navigation instructions and lists without needing images. My workflow now is simple. Before I publish anything that might contain code, special characters, or unusual punctuation, I scan it for anything the browser might misinterpret. Angle brackets get replaced with entities. Ampersands in URLs get encoded. Dashes get upgraded to proper em dashes. It takes about two minutes and it has saved me from exactly the kind of disaster that took down my C++ post. These days I keep a cheatsheet pinned in my editor with the thirty or so HTML entities I use regularly. My blog has not broken from a rogue character since. And I finally finished that C++ post. With proper angle brackets, this time.