HTML Entities Encoder / Decoder

Encode text to HTML entities or decode HTML entities back to plain text.

Converts characters like <, >, &, and " into safe HTML entity equivalents.

Plain Text

Encoded HTML Entities

Changes update instantly

Examples

Input

<a href="https://example.com">Link & more</a>

Output

&lt;a href=&quot;https://example.com&quot;&gt;Link &amp; more&lt;/a&gt;

Input

&lt;h1&gt;Hello &amp; World&lt;/h1&gt;

Output

<h1>Hello & World</h1>

About this tool

Use this HTML entities tool to encode special characters into their HTML entity equivalents, or decode HTML entities back into readable text. It is useful for safely embedding HTML in code, escaping user input for display, and reading encoded HTML.

How to use

  • Choose encode or decode mode.
  • Paste or type your text in the input panel.
  • Copy the converted output from the result panel.

What HTML entities are

HTML entities are special sequences used to represent characters that have meaning in HTML markup, such as < (less than), > (greater than), & (ampersand), and " (double quote). Using entities prevents browsers from misinterpreting these characters as HTML tags or attributes.

Encoding text to HTML entities is important when displaying user-generated content, embedding code snippets in pages, or writing HTML that should appear as text rather than rendered markup.

Encoding versus decoding

Encoding converts plain text with special characters into safe HTML entity sequences. Decoding reverses this, turning entity sequences back into the original characters. Both directions are useful depending on whether you are preparing content for HTML output or reading encoded content.

FAQ

What characters get encoded?

The encoder converts &, <, >, ", and ' into their HTML entity equivalents (&amp;, &lt;, &gt;, &quot;, &#39;).

What entities can be decoded?

The decoder handles named entities like &amp;, &lt;, &copy;, &euro;, numeric entities like &#169;, and hex entities like &#xA9;.

Is this the same as URL encoding?

No. HTML entity encoding is for safe HTML display, while URL encoding is for encoding characters in URLs. They use different formats and serve different purposes.

Related Tools