Input

IN
Input
0 chars
OUT
Output
0 chars
#
Entities
0

Output

Common HTML Entities - Click to Insert

About HTML Entity Encoder/Decoder

Convert special characters to safe HTML entities or decode entities back to readable text. Essential for displaying code in HTML, preventing XSS, and handling special characters in web content.

Named, decimal, and hex formats
Real-time conversion
90+ named entities supported
Click-to-insert entity reference

Complete Guide to HTML Entities

Free Online HTML Entity Encoder & Decoder

Encode and decode HTML entities with our free online tool. Convert special characters like <, >, &, and quotes to their HTML entity equivalents, or decode entity strings back to readable text.

What Are HTML Entities?

HTML entities are special codes used to represent characters that have special meaning in HTML or characters that are not 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; to prevent browsers from interpreting it as an HTML tag.

Types of HTML Entities

Named Entities

  • Human-readable format
  • Example: &amp; &lt; &gt;
  • Easy to remember
  • Limited to predefined names
  • Most commonly used type

Decimal Entities

  • Uses Unicode code point
  • Example: &#38;#38; &#38;#60; &#38;#62;
  • Works for any character
  • Universal browser support
  • Format: &#38;#NUMBER;

Hexadecimal Entities

  • Hex Unicode code point
  • Example: &#38;#x26; &#38;#x3C; &#38;#x3E;
  • Works for any character
  • Matches Unicode charts
  • Format: &#38;#xHEX;

Why Use HTML Entities?

Security (XSS Prevention)

  • Prevent cross-site scripting attacks
  • Safely display user-generated content
  • Escape HTML in form inputs
  • Protect against code injection
  • Required for secure web applications

Display Special Characters

  • Show HTML code as text
  • Display < > & literally
  • Use symbols like © ® ™ € £
  • Insert math symbols (× ÷ ± ≠)
  • Add arrows, shapes, and more

Character Encoding

  • Ensure cross-platform compatibility
  • Handle accented characters (é à ü)
  • Support international characters
  • Work with legacy encodings
  • Avoid encoding issues

Code Display

  • Display HTML/XML source code
  • Show code examples in tutorials
  • Embed code snippets in pages
  • Documentation and tech writing
  • Syntax highlighting content

Essential HTML Entities

&amp; -> &
&lt; -> <
&gt; -> >
&quot; -> "
&#39; -> '
&nbsp; -> (space)
&copy; -> ©
&reg; -> ®
&trade; ->
&euro; ->
&pound; -> £
&deg; -> °

How to Use This Tool

  1. Choose Mode: Select Encode to convert text to entities, or Decode to convert entities back to text.
  2. Select Format: When encoding, choose named, decimal, hexadecimal, or all-characters mode.
  3. Enter Text: Type or paste your text or HTML entities into the input area.
  4. View Output: The converted result appears instantly in the output area.
  5. Insert Entities: Click any entity in the reference table to insert it.
  6. Copy or Download: Use the copy button or download in TXT, HTML, or JSON format.
  7. Swap: Swap input and output and toggle the mode.

Common Use Cases

Displaying Code: When writing HTML tutorials, encode tag brackets so they display as text instead of being interpreted as markup.

Form Data: Encode user-submitted content before inserting it into HTML to prevent XSS attacks and broken layouts.

Email Templates: Use entities for special characters in HTML emails to improve compatibility across email clients.

CMS Content: Encode special characters when content might be processed by multiple systems with different encodings.

Debugging: Decode entity-heavy HTML to understand the actual content when debugging rendering issues.

Browser Compatibility

Named Entities: Major named entities like &amp;, &lt;, and &gt; are supported in every browser. Some newer names may have limited support in older browsers.

Numeric Entities: Both decimal and hexadecimal entities are universally supported across browsers.

Unicode Characters: Modern browsers support the full Unicode range through numeric entities.

Perfect For

  • Web developers
  • Content writers and bloggers
  • Email template designers
  • CMS administrators
  • Security engineers
  • Technical writers
  • SEO specialists
  • Front-end developers
  • WordPress developers
  • Documentation authors
  • QA testers
  • Students learning HTML

Complete Privacy Protection

All encoding and decoding happens entirely in your browser using JavaScript. No data is sent to any server, so your content remains private.