HTML BlogCode Manual & Tools

HTML Entity Encoder & Decoder

Convert special characters to HTML entities or decode entities back to characters. Free, instant, and private.

Encode:
Input Text 0 characters
Encoded Output 0 characters
Quick Reference — Common HTML Entities

How to Use the HTML Entity Encoder

  1. Select a mode — choose Encode to convert characters into HTML entities, or Decode to convert entities back to readable characters.
  2. Configure options (Encode mode) — pick whether to encode only special characters (< > & " ') or all characters. Toggle named entities on or off.
  3. Type or paste your text — enter content in the input box. The output updates instantly as you type.
  4. Copy the result — click the Copy Output button to copy the encoded or decoded text to your clipboard.
  5. Swap if needed — click Swap to move the output back into the input field for further processing.

What Are HTML Entities?

HTML entities are special sequences of characters used to represent symbols that either have reserved meaning in HTML or cannot be easily typed with a standard keyboard. Every entity begins with an ampersand (&) and ends with a semicolon (;).

For example, the less-than sign < is reserved in HTML because it opens an element tag. To display a literal < on a web page, you must write &lt; instead. If you don't encode it, the browser may interpret it as the start of an HTML tag, breaking your page layout or creating a security vulnerability (cross-site scripting).

The five characters that must be encoded in HTML content are:

Beyond these five, HTML defines over 2,000 named entities for accented letters, mathematical symbols, currency signs, arrows, and more.

Named vs Numeric HTML Entities

HTML supports two styles of entity encoding, each with trade-offs:

Named Entities

Named entities use a human-readable mnemonic: &amp; for &, &copy; for ©, &mdash; for —. They are easier to read in source code and simpler to remember. However, only about 250 named entities are widely supported, and not every character has a named entity.

Numeric Entities

Numeric entities reference the Unicode code point of a character using either decimal (&#38;) or hexadecimal (&#x26;) notation. They work for any Unicode character, including emoji, CJK ideographs, and obscure symbols. The downside is that they are harder to read at a glance.

Which Should You Use?

Use named entities when they exist — they make your markup more readable. Fall back to numeric entities for characters without a named equivalent. This tool's Use named entities checkbox gives you the best of both worlds automatically.

Complete HTML Entity Reference

Below is a reference table of the most commonly used HTML entities, organized by category.

Character Named Entity Numeric Entity Description

Frequently Asked Questions

What are HTML entities and why do I need them?

HTML entities are special codes that represent characters with reserved meaning in HTML or characters that cannot be typed directly. You need them to display symbols like <, >, and & on a web page without the browser misinterpreting them as HTML markup. They also help display special symbols like ©, ™, and — consistently across all browsers and platforms.

Is my data safe when using this tool?

Yes, completely. All encoding and decoding runs entirely in your browser using JavaScript. No data is ever sent to a server. You can verify this by disconnecting from the internet and using the tool — it will still work perfectly.

Should I encode all characters or just special ones?

In most cases, encoding only the five special HTML characters (< > & " ') is sufficient and keeps your source code readable. Encoding all characters is useful in specific situations, such as embedding text in XML attributes, ensuring email HTML renders correctly across clients, or when working with systems that may misinterpret certain characters.

What is the difference between HTML encoding and URL encoding?

HTML encoding converts characters to HTML entities (like &amp;) for safe display in web pages. URL encoding converts characters to percent-encoded format (like %26) for safe use in URLs and query strings. They serve different purposes: HTML encoding is for content displayed on a page, while URL encoding is for data transmitted in URLs.

Can I decode numeric entities like &#8364; or &#x20AC;?

Yes, this tool fully supports decoding both decimal numeric entities (like &#8364; for the euro sign) and hexadecimal entities (like &#x20AC;). It also decodes all standard named entities. Simply switch to Decode mode, paste your encoded text, and the decoded result will appear instantly.