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

<p class="x">A & B</p>
→ &lt;p class=&quot;x&quot;&gt;A &amp; B&lt;/p&gt;

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