Shiklo Tools
PDF40
Image20
Calculators & Converters25
Text & Writing13
Developer26
Video14
Audio14
Document14
Data & Spreadsheet12
Web & SEO9
OCR & Scanning5
Archive & File12
Security & Privacy23
Health & Medical29
QR & Barcode5

HTML Entity Encoder / Decoder

Encode text as HTML entities — named, decimal or hex — or decode any HTML entity back to text. Supports all HTML5 entity names.

HTML entities let you write characters that would otherwise be read as markup, or that are awkward to type. An ampersand in text should be written &, a less-than sign <, and a copyright sign can be written ©. Encoding is essential when you show user text or code samples on a web page, and decoding is handy when you need the plain text back from HTML source, a feed or an API response.

This tool does both. Encode only the characters HTML needs escaped, or every character outside plain ASCII as well — useful for old systems and email templates that mangle accents — as readable names (é), decimal codes (é) or hexadecimal codes (é). Decoding understands all HTML5 entity names and numeric references, because it uses the browser's own HTML parser. Nothing is uploaded.

How to use HTML Entity Encoder / Decoder

  1. Paste text to encode, or HTML with entities to decode, or press Sample.
  2. Choose Encode or Decode.
  3. When encoding, choose which characters and which entity style.
  4. Copy the result or download it.

Features

  • Encodes &, angle brackets, double and single quotes.
  • Optionally encodes every non-ASCII character, including emoji.
  • Named, decimal or hexadecimal entities.
  • Decodes all HTML5 named entities and numeric references.
  • Decoding never runs or loads markup — it stays text.
  • Runs in your browser; nothing is uploaded.

When to use entities

Use entities when you show code or user-supplied text on a web page, so that tags appear as text instead of being interpreted; when writing HTML by hand and you need a character that is hard to type, such as a non-breaking space, an em dash or a copyright sign; and when a system in the chain does not handle UTF-8 correctly. Decoding is useful when text extracted from HTML, feeds, spreadsheets or API responses arrives full of entities like & and ’ and you need the readable text, for example before importing it into another system or counting its words.

Common HTML entities

These are the entities you meet most often. Any character can also be written with its Unicode number, in decimal or hexadecimal.

CharacterNamedDecimalHex
& ampersand&&&
less-than sign<<<
" double quote"""
' apostrophe—''
non-breaking space   
© copyright©©©
€ euro€€€
— em dash———

Which characters to encode

Special characters only is right for almost all modern web pages, which use UTF-8: it escapes the characters that could be mistaken for markup — ampersand, angle brackets and quotes — and leaves accented letters, symbols and emoji as they are. Choose Also non-ASCII when the text must survive a system that is not UTF-8-safe, such as some email templates, legacy content management systems or source files saved in an old encoding. The apostrophe is always written as ', because the name ' is not valid in HTML 4.

Named, decimal or hex

Named entities are the most readable but exist only for about 2,000 characters; when a character has no name, the tool writes a numeric reference instead. Decimal and hexadecimal references work for every Unicode character, including emoji, and are understood by HTML, XML and most other markup formats, which makes them the safer choice for text that may end up in XML as well. Browsers treat all three forms the same.

Safe decoding

Decoding uses the browser's own entity table, so even rare names such as ≂̸ decode correctly. Markup in the input is treated as text: a pasted image tag or script is shown as characters and never runs or loads anything. Encoding text is also the right defence when you display untrusted input in HTML, though in application code you should use your framework's escaping functions. For XML, which knows only five named entities, use the XML Escape tool.

Frequently asked questions

How do I encode HTML entities?

Paste the text, choose Encode and copy the result.

How do I decode HTML entities?

Choose Decode; all named and numeric entities become characters.

What is the entity for an ampersand?

& — or & as a number.

Should I encode accented letters?

Not on UTF-8 pages. Encode them only for systems that are not UTF-8-safe.

Are emoji supported?

Yes. They are encoded as numeric references, because they have no names.

Is my text uploaded?

No. Everything happens in your browser.

Related tools