Skip to content

HTML Entity Encoder

Encode text into HTML entities or decode entities back to plain text. Escape the special characters that would otherwise break your markup — and optionally convert all non-ASCII characters to numeric entities.

Plain text
HTML entities

About the HTML Entity Encoder

In HTML, characters like <, > and & have special meaning, so to display them literally — or to safely insert user content — they must be written as entities such as &lt;, &gt; and &amp;. Forgetting to escape them breaks layouts and opens the door to cross-site scripting.

This tool escapes those characters (and, optionally, every non-ASCII character) so your text renders exactly as written, and decodes entities back to readable text. Everything runs locally in your browser.

How to use it

  1. 1Paste text to encode, or entities to decode.
  2. 2Optionally encode all non-ASCII characters as numeric entities.
  3. 3Copy the escaped or unescaped result.

Features

  • Encode and decode HTML entities
  • Escapes &, <, >, " and ' for safe markup
  • Option to encode all non-ASCII characters
  • Handles named and numeric entities on decode
  • One-click copy

Frequently asked questions

What are HTML entities?

HTML entities are encoded representations of characters, like &amp; for & or &lt; for <. They let you display reserved characters literally and include symbols not on the keyboard.

Why escape HTML?

Escaping prevents special characters from being interpreted as markup, which keeps your page rendering correctly and helps prevent cross-site scripting (XSS) when inserting untrusted text.

What is the difference between named and numeric entities?

Named entities use words (&copy;) while numeric entities use code points (&#169; or &#xA9;). Both produce the same character; numeric works for any character.

Is my text uploaded?

No. Encoding and decoding run entirely in your browser.

Related tools