🏷️

HTML Entity Encode / Decode

Bidirectional conversion between plain text and HTML entities. Supports named entities (&), decimal (&), and hex (&) numeric formats.

Developer Tools Runs locally No data sent
encode html entities client-side
Format:
Scope:
Plain Text
→
HTML Entities
Common HTML Entities Reference
CharNamedNumericDescription

What are HTML Entities?

HTML entities are encoded forms of characters that would otherwise be interpreted specially in HTML, such as <, >, &, and quotes. They are useful when you need to display markup literally or safely insert text into HTML contexts.

How to Use HTML Entity Encoder / Decoder

  1. Paste the source text or encoded entity string into the input.
  2. Choose encode when you need HTML-safe output, or decode to get readable text back.
  3. Review named or numeric entity output depending on your use case.
  4. Copy the converted result into your page, template, or payload.
Understand HTML Entities ▾
Example
Input Input: <script>alert('XSS')</script>
Output Encoded output: &lt;script&gt;alert('XSS')&lt;/script&gt;
Common Use Cases
  • Escape user-generated content before inserting it into HTML to prevent XSS attacks
  • Display code samples in HTML without the browser interpreting the tags
  • Include special characters (©, ™ → ₀ in HTML without relying on keyboard input
  • Decode HTML entities from an API or scraping result back to readable text
Why Use This Tool
  • Useful for escaping code samples and preventing unintended HTML rendering.
  • Helps decode entity-heavy content from scrapers, APIs, and legacy systems.
  • Makes it easy to compare named and numeric entity output quickly.
Frequently Asked Questions
What is the difference between HTML entities and URL encoding?

HTML entities encode special characters for safe rendering inside HTML documents ( &lt; for < ). URL encoding converts characters for safe transmission in URLs ( %3C for < ). Use HTML entities for HTML content, URL encoding for query parameters and URL components.

Do I need to encode all non-ASCII characters?

Not necessarily. Modern HTML documents declare UTF-8 encoding ( <meta charset="UTF-8"> ), which allows most Unicode characters to appear as-is. Entities are most important for the five characters with special HTML meaning: < , > , & , " , and ' .

What is the difference between named and numeric entities?

Named entities use a defined name: &amp; , &copy; . Numeric entities use a decimal ( &#38; ) or hex ( &#x26; ) code point. All three forms produce the same character; named entities are more readable while numeric entities work for any Unicode character.

What does HTML Entity Encoder / Decoder Online —Escape HTML Free do?

HTML Entity Encoder / Decoder Online —Escape HTML Free runs entirely in your browser and helps you complete this task without uploading data to a server.