HTML entities encode

This will encode or decode base64, urlencode, rot13 or htmlentities to its counterpart.

How to encode HTML entities

  1. Paste your text or code snippet into the Input box. HTML entities encode is already selected.
  2. Press Submit.
  3. Copy the escaped text from the Output box into your HTML.

Examples

  • <p class="x"> becomes &lt;p class&equals;&quot;x&quot;&gt;
  • © 2026 Ünïcode — ’ becomes &copy; 2026 &Uuml;n&iuml;code &mdash; &rsquo;
  • Fish &amp; chips & <b> becomes Fish &amp; chips &amp; &lt;b&gt;

What gets encoded

  • Every character that has a named HTML5 entity, including <, >, &, both quote marks, accented letters and typographic symbols. HTML5 has names for some everyday punctuation too, such as &equals; for = and &sol; for /.
  • Line breaks become &NewLine;, so a multi-line input turns into one long line.
  • Characters without a named entity, like most emoji and non-Latin scripts, stay as they are. That's fine on any UTF-8 page.
  • Entities already in your text are not encoded again: &amp; stays &amp; (see the third example).

When to use it

Use it to show code samples or user-written text on a web page, so the browser displays <b> instead of making text bold, and to keep stray < and & characters from breaking your markup.

FAQ

Do I need all those named entities? On a UTF-8 page, only <, >, & and quotes inside attributes really need escaping. Encoding more is harmless but makes the text longer.

Need the other direction? Use HTML entities decode.


Base64 decode encode

Base64 is a byte sequence of 8-bit padded ascii in mime.

More: Wikipedia and RFC 2045

URLencode decode encode

Tyically used for passing strings and variables between web pages

More info: php.net and RFC 3986


ROT13 encode

Rotates the characters 13 places. Since the basic latin1 alphabet has 26 characters, performing rot13 on a string encrypts it. Do it twice, and it's decrypted.

More info: Wikipedia and php.net

HTMLentities decode encode

Encodes or decodes all characters that have a HTML equivalent entity.

More info: php.net and w3.org