HTML Encoder/Decoder

Convert text to HTML entities or decode HTML entities back to readable text. Supports named (©), decimal (©), and hexadecimal (©) entities. 100% client-side processing for complete privacy and security.

Input

⚡ Encoding

0 characters, 0 bytes, 1 line

Output

Use Case Templates

Click "Try This Example" to load pre-built templates for common scenarios.

💻

Display Code Snippet

Show HTML code on a web page without it being interpreted

Input:

<div class="example">Hello World</div>

Output:

&lt;div class="example"&gt;Hello World&lt;/div&gt;
📧

Email Template Special Chars

Encode special characters for email HTML

Input:

Use our service & save 50% today!

Output:

Use our service &amp; save 50% today!
💬

Quote Handling

Properly encode quotes in HTML attributes

Input:

He said "Hello" & left

Output:

He said &quot;Hello&quot; &amp; left
©️

Copyright Notice

Display copyright and trademark symbols

Input:

© 2024 Company™. All rights reserved®.

Output:

&copy; 2024 Company&trade;. All rights reserved&reg;.

Math Symbols

Encode mathematical notation

Input:

x ≤ 10 and y ≥ 5

Output:

x &le; 10 and y &ge; 5
🌍

International Text

Handle accented and special characters

Input:

Café résumé naïve

Output:

Caf&eacute; r&eacute;sum&eacute; na&iuml;ve
💰

Currency Symbols

Encode various currency symbols

Input:

Price: €50 | £40 | ¥5000

Output:

Price: &euro;50 | &pound;40 | &yen;5000
➡️

Arrow Symbols

Display directional arrows

Input:

Navigate: ← → ↑ ↓

Output:

Navigate: &larr; &rarr; &uarr; &darr;

Entity Reference Table

Search and copy HTML entities. Click any format to copy to clipboard.

Showing 142 entities

CharNamedDecimalHexDescription
<Less than
>Greater than
&Ampersand
"Quotation mark
'Apostrophe
©Copyright
®Registered trademark
Trademark
Euro
£Pound
¥Yen
¢Character (U+00A2)
§Character (U+00A7)
Character (U+00B6)
°Character (U+00B0)
±Character (U+00B1)
×Character (U+00D7)
÷Character (U+00F7)
Non-breaking space
Character (U+2013)
Character (U+2014)
Character (U+2018)
Character (U+2019)
Character (U+201C)
Character (U+201D)
Character (U+2039)
Character (U+203A)
«Character (U+00AB)
»Character (U+00BB)
Math symbol
Math symbol
Math symbol
Math symbol
Math symbol
Math symbol
Math symbol
Math symbol
Math symbol
Math symbol
Math symbol
Math symbol
Arrow
Arrow
Arrow
Arrow
Arrow
Arrow
Arrow
Arrow
Arrow
Arrow
αGreek letter
βGreek letter
γGreek letter
δGreek letter
εGreek letter
ζGreek letter
ηGreek letter
θGreek letter
λGreek letter
μGreek letter
πGreek letter
σGreek letter
ωGreek letter
ΑGreek letter
ΒGreek letter
ΓGreek letter
ΔGreek letter
ΘGreek letter
ΛGreek letter
ΣGreek letter
ΩGreek letter
Character (U+2026)
·Character (U+00B7)
Character (U+2022)
Character (U+2030)
Character (U+2032)
Character (U+2033)
Character (U+203E)
Character (U+2044)
ÀCharacter (U+00C0)
ÁCharacter (U+00C1)
ÂCharacter (U+00C2)
ÃCharacter (U+00C3)
ÄCharacter (U+00C4)
ÅCharacter (U+00C5)
ÆCharacter (U+00C6)
ÇCharacter (U+00C7)
ÈCharacter (U+00C8)
ÉCharacter (U+00C9)
ÊCharacter (U+00CA)
ËCharacter (U+00CB)
ÌCharacter (U+00CC)
ÍCharacter (U+00CD)
ÎCharacter (U+00CE)
ÏCharacter (U+00CF)
ÐCharacter (U+00D0)
ÑCharacter (U+00D1)
ÒCharacter (U+00D2)
ÓCharacter (U+00D3)
ÔCharacter (U+00D4)
ÕCharacter (U+00D5)
ÖCharacter (U+00D6)
ØCharacter (U+00D8)
ÙCharacter (U+00D9)
ÚCharacter (U+00DA)
ÛCharacter (U+00DB)
ÜCharacter (U+00DC)
ÝCharacter (U+00DD)
ÞCharacter (U+00DE)
ßCharacter (U+00DF)
àCharacter (U+00E0)
áCharacter (U+00E1)
âCharacter (U+00E2)
ãCharacter (U+00E3)
äCharacter (U+00E4)
åCharacter (U+00E5)
æCharacter (U+00E6)
çCharacter (U+00E7)
èCharacter (U+00E8)
éCharacter (U+00E9)
êCharacter (U+00EA)
ëCharacter (U+00EB)
ìCharacter (U+00EC)
íCharacter (U+00ED)
îCharacter (U+00EE)
ïCharacter (U+00EF)
ðCharacter (U+00F0)
ñCharacter (U+00F1)
òCharacter (U+00F2)
óCharacter (U+00F3)
ôCharacter (U+00F4)
õCharacter (U+00F5)
öCharacter (U+00F6)
øCharacter (U+00F8)
ùCharacter (U+00F9)
úCharacter (U+00FA)
ûCharacter (U+00FB)
üCharacter (U+00FC)
ýCharacter (U+00FD)
þCharacter (U+00FE)
ÿCharacter (U+00FF)

What is HTML Encoding?

HTML encoding (also called HTML escaping) is the process of converting special characters into their HTML entity equivalents. For example, the less-than symbol < becomes &lt;. This is essential for:

  • Security - Preventing XSS (Cross-Site Scripting) attacks by neutralizing malicious HTML/JavaScript
  • Display - Showing HTML code snippets on web pages without the browser interpreting them
  • Compatibility - Ensuring special characters display correctly across different browsers and systems
  • Data Integrity - Preserving special characters in forms, databases, and APIs

Types of HTML Entities

HTML entities come in three formats. Each has its own advantages depending on your use case:

Named Entities

Use memorable names like &copy; for © or &lt; for <.

✓ Easy to read✓ Self-documenting⚠ Limited availability

Decimal Entities

Use decimal Unicode code points like &#169; for © or &#60; for <.

✓ Universal support✓ All characters

Hexadecimal Entities

Use hexadecimal Unicode code points like &#xA9; for © or &#x3C; for <.

✓ Compact notation✓ Developer-friendly

When to Use HTML Encoding

💻 Displaying Code

Show HTML, XML, or code snippets on web pages (tutorials, documentation, blogs) without the browser executing them.

🔒 Security

Prevent XSS attacks by encoding user-generated content before displaying it on your website or storing it in databases.

📧 Email Templates

Encode special characters in HTML emails to ensure they display correctly across all email clients (Gmail, Outlook, etc.).

🌍 International Content

Handle accented characters, currency symbols, and non-Latin scripts in environments with limited Unicode support.

Understanding Encoding Modes

Our tool offers four encoding modes to fit different use cases:

Safe Mode

Only encodes reserved HTML characters: < > & " '

Use case: Use when you want to preserve most characters while preventing HTML injection

Hello & "World" → Hello &amp; &quot;World&quot;

Standard Mode

Encodes reserved characters plus common symbols (©, ®, ™, €, £, ¥)

Use case: Recommended for general use. Balances compatibility with readability

© 2024 & Co. → &copy; 2024 &amp; Co.

Unicode Mode

Encodes all non-ASCII characters (emoji, international text, symbols)

Use case: Use for maximum compatibility in ASCII-only environments

Café 😀 → Caf&#233; &#128512;

Preserve UTF-8

Only encodes reserved chars, preserves all UTF-8 characters as-is

Use case: Use when your target supports UTF-8 and you want to keep text readable

Café & "Test" → Café &amp; &quot;Test&quot;

Frequently Asked Questions

FAQ

HTML encoding (also called HTML escaping) converts special characters into their HTML entity equivalents. For example, < becomes &lt;. This is crucial for security (preventing XSS attacks), displaying code snippets on web pages, and ensuring proper rendering of special characters in HTML documents.

Named entities use memorable names like &copy; for ©. Decimal entities use numbers like &#169; for the same character. Hexadecimal entities use hex codes like &#xA9;. Named entities are easier to read, but not all characters have named entities. Decimal and hex entities work for any Unicode character.

Safe Mode only encodes characters that could break HTML (< > & " '). Use it when you want to preserve most characters as-is while preventing HTML injection. Standard Mode encodes reserved chars plus common symbols like © ® ™ € for maximum compatibility across different systems and browsers.

It depends on your selected mode. Preserve UTF-8 Mode keeps emoji and international characters as-is (only encoding reserved HTML chars). Unicode Mode encodes all non-ASCII characters including emoji, Chinese, Japanese, Arabic, etc. into numeric entities. Choose based on your target environment's Unicode support.

Our tool automatically detects if your input already contains HTML entities and provides warnings. In 'Standard' and 'Safe' modes, already-encoded entities are preserved. However, always review your output, especially when processing content from unknown sources that may already be partially encoded.

Yes! The tool automatically detects if your input contains HTML entities and switches to decode mode. It supports all three entity types (named, decimal, hexadecimal). Simply paste your encoded HTML and the tool will convert it back to readable text. You can also manually toggle between encode/decode modes.

100% safe and private. All encoding and decoding happens entirely in your browser using JavaScript. Your text never leaves your device or gets sent to any server. We don't collect, store, or transmit any of your data. You can even use this tool offline after the page loads.

You can upload .html, .htm, and .txt files up to 5MB. The tool reads the file content and processes it based on your selected encoding/decoding mode. Perfect for batch processing entire HTML files or text documents containing special characters.

Search 100+ entities by character, name, or description. Click any format to copy it instantly. It's the fastest way to find codes for specific symbols.

Treat each line as an independent item. It's ideal for processing lists of variables or server logs without character 'bleeding' between lines.

Click 'Generate Share Link' to copy a URL containing your text and settings. For stability, this is limited to inputs under 2,000 characters.

Yes! Paste a link into the fetch field to load its source. Note that some sites block this via CORS policies, requiring manual copy/pasting instead.

Absolutely! Encode special characters and symbols to ensure your email templates render correctly across all clients like Gmail, Outlook, and Apple Mail.