HTML Encoder

Encode special characters into HTML entities.

HTML Encoder turns characters like <, >, and & into entities so you can display code samples as text inside HTML pages.

Input
Output

When to use HTML Encoder

  • Publishing code examples on a webpage
  • Escaping user-facing text that includes tags
  • Preparing snippets for documentation

Example

Input

<p>A & B</p>

Output

&lt;p&gt;A &amp; B&lt;/p&gt;

How to use

  1. Paste raw text. Include any <, >, &, or quotes you need escaped.
  2. Encode. Run to convert special characters into entities.
  3. Paste into HTML. Use the encoded text where the browser should show symbols, not tags.

Processing and limitations

Escapes ampersands, angle brackets and both quote characters. This is text escaping, not a general HTML sanitizer. Encode once; encoding an existing entity again produces &amp;lt;.

Reference

Benefits

  • Free to use—no account required
  • Runs in your browser
  • Instant results with no software install
  • Basic processing does not upload your content to a server
  • Encoding is for display. Decoding reverses entities back to characters.

Not the same as

To remove tags entirely, use HTML Tag Stripper. To decode entities, use HTML Decoder.

Related tools