← Back to tools

HTML Entity Encoder / Decoder

Convert special characters to HTML entities or decode them back.

Input
Output
Common entities: &amp; → &   &lt; → <   &gt; → >   &quot; → "   &apos; → '   &nbsp; → (space)   &copy; → ©   &mdash; → —

HTML entities are special codes that represent characters which have reserved meaning in HTML. The angle brackets < and > define HTML tags, so to display them as literal text you must encode them as &lt; and &gt;. The ampersand & itself becomes &amp;.

Beyond reserved characters, entities are also used for characters not available on a standard keyboard — like &copy; (©), &mdash; (—), &euro; (€), and Unicode characters like &#9829; (♥). Named entities are easier to read; numeric entities (&#60;) work for any Unicode code point.

Proper encoding prevents XSS (Cross-Site Scripting) attacks where malicious <script> tags are injected into user-generated content. Any user input displayed in HTML should always be entity-encoded first. This tool handles both encoding and decoding for quick reference and testing.

This tool in other languages:

Français:
Encodeur d'entités HTML

Español:
Codificador de entidades HTML

Deutsch:
HTML-Entity Encoder

Português:
Codificador de entidades HTML

日本語:
HTMLエンティティエンコーダー

中文:
HTML 实体编码工具

한국어:
HTML 엔티티 인코더

العربية:
مشفر كيانات HTML