FormatterHQ

Text to HTML Entities

Convert special characters and symbols in any text into HTML entity codes, using readable names like ♥ wherever HTML5 defines one.

Loading tool…
Ready.

How to use the Text to HTML Entities

  1. Type or paste into the Text box, or click Sample. You can also drop a text file on either box, or load one into the HTML entities box with its Open file button.
  2. The HTML entities box updates live as you type. It works both ways — edit the HTML entities side to convert back, or click ⇄ Swap to exchange the sides.
  3. Adjust Use named entities (©) and Encode every character in the options bar above the editors; the result refreshes immediately.
  4. Use Copy or Download on either box to take the result, or Clear to start again.

Text to HTML entities for symbols and special characters

The text to HTML entities converter is the quickest way to find the entity code for a symbol. Paste a heart, a trademark sign, an arrow or an accented name, and each character is replaced with its HTML5 named entity — ♥, ™, →, é — or a hexadecimal reference when no name exists.

Example

Input:

Ünïcödé “quotes” — 5 × 3 ≠ 16 ♥ ☺

Output:

Ünïcödé “quotes” — 5 × 3 ≠ 16 ♥ ☺

Frequently used entities

SymbolNamed entityNumeric
©©©
®®®
™™™
———
“ ”“ ”“ ”
€€€
×××
non-breaking space  

Named entities are case-sensitive and must end with a semicolon to be safe in every context. Copy them exactly as the tool writes them — É and é are different letters.

Why use entities instead of the character?

On a page saved and served as UTF-8 you can type any of these characters directly. Entities are still useful when:

  • you are editing HTML in a tool or keyboard layout where the symbol is hard to type;
  • the text goes into an email template, a legacy ISO-8859-1 page or an ASCII-only configuration file;
  • you want invisible characters such as  , ­ (soft hyphen) or ‍ to be visible and deliberate in the source code.

Entities in different contexts

  • Entities work in HTML element content and attribute values, and in most Markdown renderers, which pass them through to HTML.
  • XML only predefines five names, so use numeric references such as ♥ in XML, SVG and RSS files.
  • Email subject lines and plain-text emails are not HTML; entities there appear literally. Type the character itself instead.

Plain ASCII letters, digits and punctuation stay as they are unless you tick Encode every character. The markup characters < > & " ' and the backtick are always converted, so the output is safe to paste into HTML.

Need the reverse? HTML Entities to Text decodes entity codes back into symbols. For a full character code table in decimal, hex and binary, try Char to ASCII. The conversion runs in your browser.

When to tick "Encode every character"

By default only characters that need it are converted, which keeps the HTML readable. Encoding every character, letters included, has a few narrower uses:

  • Testing decoders. A string made entirely of entity references is a good check that a template engine, feed parser or email client decodes them instead of showing codes.
  • Keeping text away from naive find-and-replace. Build scripts that search the source for a word will not match its encoded form.
  • Light email obfuscation. Encoding an address in a mailto: link hides it from the simplest harvesters, but any scraper that decodes HTML the way a browser does reads it instantly, so do not rely on it for protection.

The result is several times longer than the input and hard to edit, so keep the original text somewhere and convert again after changes rather than editing the encoded form.

Frequently asked questions

What is the HTML entity for a heart?
The named entity is &hearts; (♥), with numeric equivalents &#9829; and &#x2665;. Paste the symbol into the tool to get the code for any other character.
Are HTML entity names case-sensitive?
Yes. &Eacute; is É and &eacute; is é. Always copy the name exactly as the tool outputs it.
Why do some characters get &#x…; instead of a name?
Only about 2,000 characters have a named entity in HTML5. All others, including most emoji and CJK characters, are written as hexadecimal numeric references.
Do entities work in CSS or JavaScript?
No. Entities are an HTML feature. In CSS use escapes like \2665, and in JavaScript use \u2665.

Last updated October 3, 2026

Related tools