HTML Entity Decoder

Encode and decode HTML entities instantly. Convert between special characters and entity references. All processing in your browser.

Instant Conversion Encode & Decode Client-Side Processing

How to Use HTML Entity Decoder

1

Choose mode

Select Encode to convert characters to entities, or Decode to convert entities back to characters.

2

Enter your text

Paste or type the text containing HTML entities or raw characters.

3

Get result

The converted result appears instantly. Copy it with one click.

What are HTML Entities?

HTML entities are special codes used to represent characters that have special meaning in HTML (like <, >, &) or characters that cannot be easily typed. They use the format &name; or &#number; or &#xhex;.

Types of HTML Entities

Named Entities

Use readable names like &amp; for &, &lt; for <, &gt; for >, &quot; for "

Decimal Numeric

Use decimal code points like &#38; for &, &#60; for <

Hexadecimal Numeric

Use hex code points like &#x26; for &, &#x3C; for <

Frequently Asked Questions

What is the difference between named and numeric entities?

Named entities use readable names like &amp; for &. Numeric entities use decimal (&#38;) or hexadecimal (&#x26;) code points. Both represent the same character.

Does the tool handle all HTML5 named entities?

Yes, the tool supports all standard HTML5 named character references including &copy;, &euro;, &mdash;, and hundreds more.

When should I use HTML entity encoding?

Use entity encoding when embedding text in HTML that contains characters like <, >, &, or quotes that could be interpreted as markup.

How many named entities does HTML5 define?

The HTML5 specification (now the WHATWG Living Standard) defines 2231 named character references - a huge expansion over HTML 4.01's 252. They include symbols like &copy; (copyright sign), &euro; (euro sign), and &check; (check mark). Every one of them also has a numeric equivalent, such as &#169; or &#xA9; for the copyright sign.

Which entities must always be escaped in HTML and XML?

In HTML, escape < as &lt;, > as &gt;, and & as &amp;, plus " as &quot; inside attribute values. XML 1.0 predefines exactly five entities - those four plus &apos; - and HTML5 supports &apos; even though HTML 4 did not. Of these, &amp; matters most: an unescaped ampersand followed by letters can be misread as the start of an entity.

What is double encoding and how do I recognize it?

Double encoding happens when already-encoded text is encoded again: & becomes &amp; and then &amp;amp;. The visible symptom is a literal &amp; or &#38; showing on the page. Fixing it means decoding exactly once at the boundary where the value enters HTML context - this tool lets you verify each pass separately.

Should I use HTML entities or percent-encoding for URLs?

They solve different problems. Percent-encoding (%20) is the URL standard from RFC 3986 and is what belongs inside href attributes; HTML entities (&amp;) escape markup characters and only apply where the URL is embedded in HTML. A query value containing & and spaces typically needs both layers: spaces percent-encoded, and the separating & written as &amp; in the markup.

Do all browsers support every HTML5 entity?

Yes - the named character reference table has been fully implemented in all major browsers since around 2014, including the legacy entities without semicolons that HTML5 keeps for backwards compatibility. Numeric references (&#169; or &#xA9;) are even safer, since they depend only on Unicode code points, not on a browser lookup table.

{-- * External Resources Component(#18 Phase 3b 内容佐证工程) * 工具页「权威引用」区块:RFC / W3C / WHATWG / ECMA / IANA / 官方规范站 / Wikipedia。 * * - 接受 :slug 属性 → 经 config/tool-sources.php 家族矩阵渲染该工具的权威引用 * - slug 未命中映射时不渲染(无权威来源的工具静默跳过) * - 链接 title 保持英文(引用源专名);description 经 * common.resources.descriptions.{key} 本地化,lang 未命中回退英文(线上不裸奔) * - 链接保持 dofollow(rel="noopener noreferrer") * * @param string|null $slug --}}