UtilityBase logoUtilityBase

Developer Tools

HTML Entity Converter

Encode special characters to HTML entities and decode them back.

Updated July 10, 2026

How to use the html entity converter

  1. 1Choose encode or decode.
  2. 2Paste your text or HTML.
  3. 3For encoding, optionally escape all non-ASCII characters.
  4. 4Copy the converted result.

Common uses

  • Displaying code samples on a web page
  • Escaping user content to prevent broken markup
  • Decoding entities from scraped or exported HTML
  • Ensuring special characters render correctly

Frequently asked questions

Which characters need to be encoded in HTML?

The five reserved characters are the ampersand, less-than sign, greater-than sign, double quote, and apostrophe. Escaping the ampersand and angle brackets is the most important, since they can be read as the start of markup and break your page or allow injection.

Why is the ampersand escaped first?

Because every entity begins with an ampersand. If you escaped angle brackets before the ampersand, you could double-encode existing entities — turning '<' into '<'. Encoding the ampersand first avoids that, and this tool does it in the correct order.

What does the non-ASCII option do?

It converts every character above standard ASCII — accented letters, symbols, emoji — into a numeric HTML entity like 'é'. That guarantees the text displays correctly even in environments with the wrong character encoding, at the cost of readability in the source.

About this tool

The HTML entity converter escapes reserved characters into HTML entities and decodes entities back to plain text. Encoding replaces the ampersand, less-than, greater-than, double quote, and apostrophe with their safe entity forms so a browser renders them as text instead of markup — the basic step for showing code or user content without breaking the page. It always escapes the ampersand first to avoid double-encoding, can optionally convert every non-ASCII character to a numeric entity, and decodes any named or numeric entity in reverse. Everything runs locally in your browser.

Like most tools on UtilityBase, the html entity converter runs entirely in your browser — nothing you enter is uploaded or stored on a server. It's free to use with no account required. Browse more developer tools here.

Was this tool helpful?

Related tools