HTML Entity Encoder & Decoder

Encode special characters to HTML entities or decode HTML entities back to text

Plain Text0 chars
Encoded Output0 chars

Enter text and click Encode/Decode to convert

About This Tool

HTML entities are special sequences used in HTML to represent characters that have reserved meaning in the markup language, such as <, >, &, and quotes. Without proper encoding, these characters can break HTML structure, cause rendering issues, or create security vulnerabilities like cross-site scripting (XSS). Our free online HTML entity encoder and decoder lets you instantly convert special characters to their HTML entity equivalents (&amp;, &lt;, &gt;, &quot;, &#39;, &nbsp;) and back again. It also supports numeric character references in both decimal (&#123;) and hexadecimal (&#x7B;) formats, covering the full Unicode range. All processing happens in your browser for complete privacy.

How to Use

  1. To encode text, paste your plain text into the input area. The tool will convert characters like <, >, &, ", ', and non-breaking spaces into their corresponding HTML entity references.
  2. To decode HTML entities, paste the entity-encoded string into the input area and switch to Decode mode. The tool will convert named entities (&amp;, &lt;, etc.) and numeric entities (&#123;, &#x7B;) back to their original characters.
  3. Click the "Convert" button to process your input. The result will appear in the output panel, ready to copy.
  4. Use the "Swap" button to exchange the input and output values. This automatically switches the mode (Encode to Decode or vice versa), making it easy to reverse a previous conversion.
  5. Copy the result to your clipboard with one click, or clear both fields to start a new conversion.

Frequently Asked Questions

The characters that must be encoded in HTML content are: & (ampersand), < (less than), > (greater than), " (double quote), and ' (single quote). Additionally, non-breaking spaces and other special Unicode characters are often encoded as entities to ensure consistent rendering across browsers and platforms.
Named entities use a descriptive name such as &amp; for & or &lt; for <. Numeric entities use a decimal or hexadecimal code point, such as &#38; or &#x26; for &. Named entities are more readable for common characters, while numeric entities can represent any Unicode character.
The < and > characters are used to define HTML tags. When they appear in text content without encoding, the browser interprets them as tag delimiters, which breaks the page structure. Encoding them as &lt; and &gt; ensures they are treated as text content rather than markup.
Yes. All encoding and decoding happens entirely in your browser using client-side JavaScript. Your text is never sent to any server, ensuring complete privacy for any content you process.
Advertisement