URL Encode Encode & decode URL strings Find & Replace Search & replace in bulk Text Cleaner Remove formatting & clean text
Mode
Common HTML Entities
& — &
&lt; — <
&gt; — >
&quot; — "
&apos; — '
&nbsp; — non-breaking space
&copy; — ©
&reg; — ®
&mdash; — —
&euro; — €
How It Works
  1. 1Choose Encode or Decode mode in the left panel.
  2. 2Paste your text or HTML into the Input box.
  3. 3The result appears instantly on the right.
  4. 4Use ⇅ Swap to flip input/output, then Copy.

What is HTML Encoding?

HTML encoding is the process of converting characters that have special meaning in HTML — such as <, >, and & — into their corresponding HTML entities: safe text representations that browsers display visually rather than interpret as code. For example, the less-than sign < becomes &lt;, the greater-than sign > becomes &gt;, and the ampersand & becomes &amp;.

HTML entities exist for two main reasons. First, correctness: without encoding, a character like < inside body text would be treated by the browser as the opening of an HTML tag, potentially breaking the page layout. Second, security: encoding user-supplied input before inserting it into a page is a fundamental defense against XSS (Cross-Site Scripting) attacks — a class of vulnerability where malicious JavaScript is injected into a page and executed in other users' browsers.

All encoding and decoding in this tool runs entirely in your browser. Your text never leaves your device — no server, no storage, no signup required.

HTML Entities Reference Table

The most commonly used HTML entities, covering reserved characters, symbols, and punctuation:

CharacterEntity nameEntity numberDescription
&&amp;&#38;Ampersand — must always be encoded
<&lt;&#60;Less-than — opens HTML tags if unencoded
>&gt;&#62;Greater-than — closes HTML tags
"&quot;&#34;Double quote — encode inside attributes
'&apos;&#39;Single quote / apostrophe
©&copy;&#169;Copyright symbol
®&reg;&#174;Registered trademark
&euro;&#8364;Euro sign
£&pound;&#163;Pound sterling
&check;&#10003;Check mark
×&times;&#215;Multiplication / close symbol
&rarr;&#8594;Right arrow
&larr;&#8592;Left arrow
&nbsp;&#160;Non-breaking space
&mdash;&#8212;Em dash

How to Use This HTML Encoder / Decoder — Step by Step

The tool has two modes, switchable with the Encode / Decode tabs at the top of the tool card:

  1. Encode mode — Paste any text or HTML markup into the left panel. The tool converts <, >, &, ", and ' into their safe entity equivalents. Use this when you want to display HTML code visually on a web page, or when sanitizing user input before inserting it into a template.
  2. Decode mode — Paste HTML that contains encoded entities (e.g., text you copied from a CMS, an API response, or a database export). The tool converts &lt; back to <, &amp; back to &, and so on — giving you the readable, original text.
  3. Copy the result — Click "Copy result" to copy the output to your clipboard in one click.
  4. Swap input and output — Click "Swap" to move the output back into the input field for further editing or re-encoding in the opposite direction.

Use Cases

HTML Encoding vs. URL Encoding — Key Difference

HTML encoding converts characters to named or numeric HTML entities (e.g., <&lt;) so they are safe to include in an HTML document without breaking the markup structure. It is used for page content.

URL encoding converts characters to percent-encoded sequences (e.g., a space → %20, &%26) so they can be safely transmitted inside a URL without breaking the query string. It is used for web addresses and form data.

Both are forms of character escaping, but they operate in entirely different contexts and use different encoding schemes. If you need URL encoding, use the URL Encode / Decode tool.

Related Tools

Frequently Asked Questions

What are HTML entities?

HTML entities are text codes that represent characters which have special meaning in HTML or cannot be typed directly. They start with & and end with ;. For example, &lt; displays as < and &amp; displays as &. Entities ensure that characters are shown visually rather than interpreted as HTML markup.

When do I need to encode HTML?

You need to encode HTML when displaying code examples on a web page (so they appear as text, not rendered markup), when inserting user-generated content into a page template (to prevent XSS), when working with CMS rich-text editors, or when embedding special typographic symbols like copyright signs, currency, or arrows in an HTML document.

How do I display < and > on a web page without them being treated as HTML tags?

Replace < with &lt; and > with &gt; in your HTML source. The browser renders them as the visible characters rather than as tag delimiters. Use the Encode mode in this tool to do that conversion automatically for any block of text or code.

What is the difference between HTML encoding and URL encoding?

HTML encoding produces entities like &lt; and &amp; — used to safely include special characters in HTML content. URL encoding produces percent sequences like %3C and %26 — used to safely include special characters in URLs and query strings. They are different systems for different contexts.

What is XSS and how does HTML encoding prevent it?

XSS (Cross-Site Scripting) is a security attack where malicious JavaScript is injected into a web page and executed in other users' browsers — potentially stealing session cookies, redirecting users, or performing actions on their behalf. HTML encoding neutralizes this by converting < to &lt; and > to &gt;, so injected script tags appear as plain visible text instead of executable code.

From the Blog

See all guides →