Zentpal · Free online tools

HTML entity encoder — make code safe to show

To show code on a web page without the browser running it, characters like <, > and & must be written as entities: &lt;, &gt;, &amp;. This tool encodes text into entity form, and decodes entity-laden text back to normal.

Bloggers use it to display code snippets; developers use it when generating HTML from user text — a basic step in preventing broken pages and injection bugs.

Open the free html entity encoder on Zentpal — free, no sign-in needed, and it runs in your browser.

How to use it

  1. Pick Encode or Decode.
  2. Paste your text or HTML.
  3. Copy the converted result.

Frequently asked questions

Which characters get encoded?
The essential five — & < > " and ' — plus an option for non-ASCII characters, which become numeric entities like &#169; for ©.

Is entity encoding the same as URL encoding?
No: entities are for inside HTML documents (&amp;), percent-encoding is for inside URLs (%26). Same idea — escaping — different neighbourhoods.

Why does & show as &amp; in source?
Because & starts an entity in HTML, a literal ampersand must itself be escaped. Forgetting it is one of the most common causes of invalid HTML.

Related free tools

Community feed · Chat rooms · Free tools · Local shops · About · Privacy