Heart Symbol in Text and HTML
The heart characters written the ways a machine wants them — HTML entity, numeric reference, percent-encoded — plus what happens in a field that only takes ASCII.
Tap any tile to copy it. Nothing is sent anywhere — the copy happens in your browser.
There is no ASCII heart
ASCII is 128 codepoints, U+0000 to U+007F, and no heart is among them. Every character on this
page sits far above that range. A field that accepts ASCII only will reject or strip all of them,
and no font setting changes that, because the restriction is on the characters the field will
store, not on how they are drawn.
<3 is what people use instead, and it is worth being precise about what it is:
two ASCII characters, a less-than sign and the digit three, sitting next to each other. It is not
a character and nothing turns it into one on its own. Where it appears as a heart, some piece of
software has matched the pair and substituted an image or a real character — the two typed
characters are still what was stored.
Three ways to write the same character in HTML
A heart can go into an HTML document literally, as a decimal numeric character reference, or as
a hexadecimal one. All three produce the identical character; the numeric forms are useful when
the file’s encoding is uncertain or when a template mangles non-ASCII bytes.
| Character | Codepoint and name | Decimal | Hex |
|---|---|---|---|
| ♡ | U+2661 WHITE HEART SUIT | ♡ |
♡ |
| ♥ | U+2665 BLACK HEART SUIT | ♥ |
♥ |
| ❣ | U+2763 HEAVY HEART EXCLAMATION MARK ORNAMENT | ❣ |
❣ |
| ❤ | U+2764 HEAVY BLACK HEART | ❤ |
❤ |
| ❥ | U+2765 ROTATED HEAVY BLACK HEART BULLET | ❥ |
❥ |
| ❦ | U+2766 FLORAL HEART | ❦ |
❦ |
| ❧ | U+2767 ROTATED FLORAL HEART BULLET | ❧ |
❧ |
| ☙ | U+2619 REVERSED ROTATED FLORAL HEART BULLET | ☙ |
☙ |
Only one of the eight has a named entity: ♥ for U+2665, which comes
from the card-suit set alongside ♠, ♦ and
♣. The ornament hearts were never given names, so a numeric reference is
the only short form for them.
Three further characters answer to HEART by name without being heart shapes — U+2E96 CJK RADICAL HEART ONE
(⺖), U+2E97 CJK RADICAL HEART TWO (⺗) and U+2F3C KANGXI RADICAL HEART (⼼). They are radical characters,
listed here only so a numeric reference found in a file can be identified.
In a URL a heart cannot appear raw. It is percent-encoded from its UTF-8 bytes, so U+2665
becomes %E2%99%A5 — three bytes, nine characters. That length is worth knowing if a
field has a character limit.
A font does not add characters
Changing the font never changes which character is stored. If a heart shows as a blank or a box,
the font has no glyph for that codepoint and something else has been substituted to draw it; the
text underneath is unchanged and will paste out correctly elsewhere.
This gives you a test for a heart you did not paste yourself. Change the font on it. If the
shape changes into something that is not a heart, or if pasting it into a plain-text field produces
something else, then the shape was never coming from the character and will not travel with it. A
heart taken from the table above has nothing to go wrong: the codepoint is the heart.
Size is not in the character
Nothing here is a big heart or a small one. Size comes from the font size around it and from
whether the character is drawn in its emoji form —
tiny heart symbols covers both. The eight shapes and what
separates them are on heart symbols. The same three-way choice — literal, named entity, numeric reference — governs the marks on
copyright and trademark symbols. The whole
reference is at symbols to copy and paste.