My Personal HTML Escapes & Special Characters Cheat Sheet

This is my own quick reference so I don't get misled by old 1995 specs anymore.

Last updated: March 1, 2026 • For HTML5 / UTF-8

Created and maintained by Joseph Rosevear. Many thanks to Grok (xAI) for help with the structure, modern HTML5 guidance, and escaping the traps of old specs.

Most common punctuation — just type them directly in text content

Character Type directly Entity (only if needed) When to use entity
" (double quote) " " or " Inside double-quoted attributes only
' (apostrophe / single quote) ' ' or ' Inside single-quoted attributes only
- (hyphen-minus) - - Almost never — only in very rare parsing edge cases
& (ampersand) & & Always when you want a literal & (e.g. AT&T)
< (less than) < &lt; or < When displaying literal < (code, examples)
> (greater than) > &gt; or > When displaying literal > (code, examples)

Useful typographic dashes & symbols (use these)

Character Preferred entity Numeric Notes / Example
– (en dash) &ndash; Best for compound names: Zombie–Slackware(R)
— (em dash) &mdash; For parenthetical breaks — like this
‑ (non-breaking hyphen) Glue words together: non‑breaking
  (non-breaking space) &nbsp;   Prevent line breaks: Mr.&nbsp;Smith
® (registered trademark) &reg; ® Slackware&reg; or Slackware(R) in plain text

Quick rules for 2026 HTML

External References