N
NJHTools

HTML Entity Encoder / Decoder

Convert special characters like <, >, and & into safe HTML entities — or decode entities back to readable text. Everything runs right in your browser.

Encode and Decode each keep their own input.

Plain text input0 characters
HTML entities output

How to use the HTML Entity Encoder / Decoder

  1. Pick a mode with the tabs: Encode to convert text into entities, or Decode to convert entities back to text.
  2. Paste or type your content into the left input box — for example HTML markup, a code snippet, or text containing &, <, and >.
  3. When encoding, choose an output format — Named (&amp;), Decimal (&#38;), or Hex (&#x26;).
  4. Tick Encode all non-ASCII characters to also convert accented letters, emoji, and other Unicode characters into entities.
  5. The result appears instantly on the right — click Copy to grab it, or Try a sample to load an example.

Everything runs locally in your browser — your text is never sent to a server.

Frequently Asked Questions

What are HTML entities and why are they needed?↓

HTML entities are special codes that represent characters which would otherwise be interpreted as markup or are hard to type. For example, < is written as &lt; and & as &amp;. Encoding these characters prevents browsers from misreading your content as tags and lets you safely display code, math symbols, or accented letters inside HTML.

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

They are three ways to write the same character. A named entity uses a memorable label like &amp; or &copy;. A decimal numeric entity uses the character's code point in base 10, like &#38;. A hexadecimal numeric entity uses base 16, like &#x26;. All three decode to the identical character in every modern browser.

Does this tool encode emoji and accented characters?↓

By default the encoder only converts the characters that are significant in HTML — &, <, >, double quote, and single quote. If you enable the "Encode all non-ASCII characters" option, it also converts accented letters, emoji, and other Unicode characters into entities, which is useful for legacy systems that only support ASCII.

Is decoding HTML entities on this page safe from XSS?↓

Yes. Decoding reads only the textContent value of the parsed input, so your text is never rendered as live HTML. The result is treated purely as plain text, meaning a payload like a script tag is shown as characters rather than executed.

Is this HTML entity tool free and private?↓

Yes. The HTML Entity Encoder & Decoder is completely free with no signup required, and it processes everything 100% locally in your browser. Your text is never uploaded to or stored on any server.

Last updated: