HTML Entity Encoder

Escape text so it displays safely inside HTML. Choose which characters to encode and how.

FreeNo sign-upPrivate — runs in your browser
0Characters encoded
0Result length

How to use the HTML Entity Encoder

  1. Paste your textType or paste text, or a code snippet you want to show on a web page.
  2. Pick what to encodeEncode only the five special characters, or also accents, symbols and emoji, as named, decimal or hex entities.
  3. Copy the resultPaste the encoded text into your HTML. It will display exactly as typed.

Example

<p>Tom & Jerry</p> → &lt;p&gt;Tom &amp; Jerry&lt;/p&gt;

With non-ASCII on, © becomes &copy; (named), &#169; (decimal) or &#xA9; (hex).

Frequently asked questions

Why do I need to encode HTML?

Characters like < and & have special meaning in HTML. Encoding them lets you show code or user text on a page without the browser treating it as markup, and it helps prevent cross-site scripting (XSS).

Which characters must always be encoded?

In text, & and < must be encoded. Inside attribute values, also encode the quote you use around the value. The basic option encodes & < > " and ' to be safe everywhere.

Named or numeric entities?

Both work in all browsers. Named entities like &copy; are easier to read; numeric ones like &#169; cover every Unicode character, including emoji.

Popular posts from this blog

Character Counter

Speech to Text Online

Keyboard Tester