Curly quotes: ‘ ’ “ and ”
Typographic quotation marks come in four characters: opening and closing single, opening and closing double. They are separate code points from the straight quote and the straight apostrophe.
At a glance
- Character
- ‘ ’ “ ”
- Named entity
- ‘ ’ “ ”
- Decimal reference
- ‘ ’ “ ”
- Hex reference
- ‘ ’ “ ”
- Unicode code point
- U+2018, U+2019, U+201C, U+201D
- Unicode name
- LEFT and RIGHT SINGLE QUOTATION MARK, LEFT and RIGHT DOUBLE QUOTATION MARK
- In the entity reference
- Punctuation
In detail
The four characters are directional. The opening pair curls toward the text it introduces and the closing pair curls away, which is why a lazy substitution that replaces every straight quote with the same curly one looks wrong immediately. Any conversion has to track whether it is at the start or the end of a quotation, and that is harder than it sounds once you allow nested quotes.
The right single quotation mark does double duty as the typographic apostrophe. That is not a hack, it is the intended use, and it means the character in the contraction dont carries the same code point as the mark closing a quoted phrase. A converter that treats every apostrophe as a closing quote gets the common case right by accident and the leading apostrophe in a shortened year wrong every time.
None of these characters need escaping in HTML. They are ordinary text in a UTF-8 document. The entities exist for the same reasons as any other punctuation entity: legacy encodings, generated email, and source files where a reviewer cannot tell one curl from the other at 13 pixels.
Where they must not appear is code. A curly quote in a JavaScript string, a CSS value, a shell command or a JSON payload is a syntax error, and the error message rarely says which character it objected to. If your content management system applies smart quotes globally, exempt code blocks explicitly rather than fixing the output afterwards.
Examples
<p>“She said ‘go on’ and left,” he wrote.</p><p>It’s the summer of ’99.</p>Both marks are U+2019. The second one leads the year, so a naive converter will curl it the wrong way.
Things that catch people out
- A search for a word with a straight apostrophe will not match the same word with a curly one. Normalise both forms in your index or users searching for a contraction get an empty result page.
- Copying a command out of a blog post that ran smart quotes over it gives you a shell error about an unexpected token. The fix is to retype the quotes, not to debug the command.
- Curly quotes inside an attribute value are legal but confusing, because they look enough like the delimiter to make a reviewer doubt the markup.
Try it: HTML Entity Reference
Search 152 entities across 9 categories, switch the copy format between the character, the name, the decimal form and the hex form, and copy in one click.
HTML Entity Reference
LOCAL · Browser-OnlySearchable reference of 150+ HTML entities with one-click copy in any format
152 entities across 9 categories
Commonly Used
→Arrows(13)
±Math(35)
$Currency(8)
…Punctuation(21)
©Symbols(24)
πGreek(30)
½Fractions(6)
●Geometric(7)
æLatin Special(8)
Click any entity card to copy it in your chosen format. All data is embedded in the page and works offline.
Related HTML entities
All html entities →Double quotation mark (") in HTML
The straight double quote ends an attribute value, so it needs " there. Where that matters, where it does not, and how JSON in a data attribute breaks.
Apostrophe (') in HTML
' is defined in HTML5 and XML but was absent from HTML 4.01. Why ' is the safer numeric form and when a single quote actually needs escaping.
Guillemets (« and ») in HTML
The double angle quotation marks at U+00AB and U+00BB, how their direction changes by language, the French spacing rule, and why they are poor UI chevrons.
Section sign (§) in HTML
The section sign at U+00A7 with its entity forms, how the doubled form marks a range of sections, and why it should never be separated from its number.
Pilcrow (¶) in HTML
The paragraph sign at U+00B6, its entity forms, its use in editors to show invisible characters, and how it works as a heading anchor without noise.
Dagger (†) and double dagger (‡)
The dagger at U+2020 and double dagger at U+2021, the traditional footnote symbol order, the case sensitive entity names, and the date convention.
Tools for this
- HTML Entity Reference Free online HTML entity reference - search and copy HTML entities with live preview
- HTML Entity Encoder Free online HTML entity encoder - encode or decode HTML entities to prevent XSS and display issues