HTML Entity Encoder & Decoder

Encode special characters to HTML entities or decode them back. Supports named entities, numeric codes, and Unicode characters.
0 characters

Options

<div class="hello">Tom & Jerry © 2025</div>
0 entities converted

Common HTML Entities

HTML Entity Reference

Character Named Decimal Hex Description

What Are HTML Entities?

HTML entities are special character sequences that represent characters which have special meaning in HTML or cannot be easily typed on a keyboard. They begin with an ampersand (&) and end with a semicolon (;). For example, the less-than sign < is written as &lt; in HTML.

There are three formats for HTML entities:

  • Named entities — Human-readable names like &amp;, &copy;, &hearts;
  • Decimal entities — Numeric codes like &#38;, &#169;
  • Hexadecimal entities — Hex codes like &#x26;, &#xA9;

Why Encode HTML Entities?

Encoding HTML entities is essential for web security and correct rendering. Without proper encoding, characters like <, >, and & can break HTML structure or enable Cross-Site Scripting (XSS) attacks. Our tool helps developers, content creators, and security professionals quickly encode and decode entities with full Unicode support.

How to Use This Tool

  1. Paste or type your text in the input area above
  2. Select Encode to convert characters to HTML entities, or Decode to convert entities back to characters
  3. Choose your preferred entity format: named, decimal, or hexadecimal
  4. Click Convert and copy the result

Frequently Asked Questions

What are HTML entities?
HTML entities are special codes used to represent characters that have reserved meaning in HTML (like <, >, &) or characters not easily typed on a keyboard. They start with & and end with ; — for example, < represents the < character.
What is the difference between named and numeric entities?
Named entities use human-readable names (e.g., &amp; for &), while numeric entities use character codes (e.g., &#38; for &). Named entities are easier to read but not available for all characters. Numeric entities work for any Unicode character.
Why do I need to encode HTML entities?
Encoding HTML entities prevents XSS (Cross-Site Scripting) attacks, ensures special characters display correctly in browsers, and avoids breaking your HTML markup when including user-generated content.
How do I use an HTML encoder decoder?
Paste your text into the input area, select Encode or Decode mode, choose your entity format (named, decimal, or hexadecimal), and click Convert. This html encoder decoder works bidirectionally — encode text to entities or decode entities back to readable characters instantly.
Can I encode and decode HTML entities in both directions?
Yes. This tool supports full bidirectional conversion. Switch between Encode and Decode modes, or use the Swap button to reverse your last conversion. You can html encode entities to any format and decode them back in a single workflow.
Does this tool send my data to a server?
No. All encoding and decoding happens entirely in your browser using JavaScript. No data is ever sent to our servers, making it completely safe for sensitive content.
What characters should I encode for HTML?
At minimum, you should encode the five XML special characters: & (&amp;), < (&lt;), > (&gt;), " (&quot;), and ' (&#39;). For full safety, encode all non-ASCII characters as well.
Can I decode numeric HTML entities?
Yes! This tool decodes both named entities (like &amp;) and numeric entities in decimal (&) or hexadecimal (&) format back to their original characters.
What is the difference between HTML encoding and URL encoding?
HTML encoding converts characters to HTML entities for safe display in web pages. URL encoding (percent-encoding) converts characters to %XX format for safe use in URLs. They serve different purposes and use different formats.