{ HTML Entity Encoder }

// encode and decode HTML entities in one click

Encode and decode HTML entities instantly in the browser. Supports named entities, numeric decimal & hex codes, full Unicode, and special characters — free, no signup.

MODE |
INPUT Plain text / HTML
OUTPUT HTML entities

Output appears here

Paste input and click Convert
// COMMON ENTITIES REFERENCE

HOW TO USE

  1. 01
    Choose encode or decode

    Use the tabs at the top to switch between encoding plain text to HTML entities, or decoding entities back to readable characters.

  2. 02
    Pick an encoding mode

    Select Named (&), Decimal (&), or Hex (&) output format. Enable "Encode all chars" to encode every character, not just special ones.

  3. 03
    Copy or download

    Click "▶ CONVERT" or type and it converts live. Copy the result or download as a .txt file. The character breakdown table shows every entity used.

FEATURES

Encode & Decode Named / Decimal / Hex Encode All Chars Char Breakdown Table Entity Reference Live Convert Download .txt Free & No Signup

USE CASES

  • 🔧 Escape HTML for safe display in code blocks and articles
  • 🔧 Encode special characters for XML and SVG content
  • 🔧 Decode entities copied from HTML source files
  • 🔧 Convert email template HTML for special character safety

WHAT IS THIS?

HTML entities are codes that represent characters with special meaning in HTML — like <, >, &, and " — or characters outside the standard ASCII range. This tool converts between plain text and their entity equivalents in three formats: named, decimal, and hexadecimal.

RELATED TOOLS

FREQUENTLY ASKED QUESTIONS

What is an HTML entity?

An HTML entity is a string that begins with & and ends with ;, representing a character that either has special meaning in HTML (like < for the less-than sign) or that is difficult to type directly (like &copy; for ©). Browsers replace entities with their corresponding characters when rendering the page.

When do I need to encode HTML?

You must encode characters like <, >, &, and " whenever they appear as literal content rather than HTML markup. This prevents browsers from misinterpreting content as tags, and is essential for security — unencoded user-generated content can lead to cross-site scripting (XSS) vulnerabilities.

What is the difference between named, decimal, and hex entities?

All three refer to the same character, just in different notations. Named entities use a human-readable keyword: &amp;. Decimal entities use the Unicode code point in base-10: &#38;. Hex entities use the code point in base-16: &#x26;. Named entities exist only for common characters; decimal and hex work for any Unicode character.

What does "Encode all chars" do?

By default, only characters with special HTML meaning or those outside ASCII are encoded. "Encode all chars" converts every character — including regular letters and digits — into their entity equivalents. The result is safe to paste into any context but much longer than necessary for typical use.

Is this tool safe to use with sensitive content?

Yes. All encoding and decoding happens entirely in your browser — no text is sent to any server. Your content never leaves your machine. The tool works offline once the page is loaded.

Can I decode multiple entities at once?

Yes. Switch to Decode mode and paste any HTML containing entities — the tool will decode all of them simultaneously, regardless of whether they are named, decimal, or hex format. Mixed formats in the same input are handled correctly.

HTML Entity Encoder & Decoder — Fast, Free, Browser-Based

HTML entities are the backbone of safe and portable HTML content. Whenever a character might be interpreted as HTML markup rather than plain text — or when a character falls outside the standard keyboard range — entities provide an unambiguous, universally supported way to represent it.

The Five Essential HTML Entities

Five characters absolutely must be encoded in HTML content: &amp; (&), &lt; (<), &gt; (>), &quot; ("), and &apos; ('). Leaving any of these unencoded in content (as opposed to markup) risks broken rendering or, in the case of user-generated content, XSS attacks. Every server-side template engine and front-end framework auto-escapes these by default for exactly this reason.

Named vs Numeric Entities

Named entities like &nbsp;, &copy;, and &mdash; only exist for a subset of HTML5-defined characters. Numeric entities — decimal (&#169;) or hex (&#xA9;) — work for any Unicode code point, making them the universal fallback for characters with no named equivalent. Both forms are supported in all major browsers and XML parsers.

Entity Encoding and XSS Security

Cross-site scripting (XSS) attacks inject malicious scripts through unescaped HTML. If a user submits <script>alert(1)</script> and your application renders it without encoding, the browser executes the script. Encoding the input to &lt;script&gt; renders it as visible text rather than executable code. This tool helps you verify your encoding is correct, test edge cases, and quickly escape HTML for safe inclusion in articles, documentation, and emails.