DEVELOPER TOOLS

HTML Entity Encoder

< > &

This tool converts characters like <, >, and & into their HTML entity equivalents (&lt;, &gt;, &amp;) so text can be safely embedded inside raw HTML without breaking the markup or being interpreted as a tag.

How to use the html entity encoder tool

  • Type or paste your text into the input box.
  • The HTML-entity-encoded result generates automatically.
  • Copy it for use inside your HTML source.

When you'd use this

Safely displaying code snippets or angle brackets inside a webpage.

Preventing user-submitted text from being interpreted as HTML markup.

Preparing text to be embedded in a static HTML template.

Frequently asked questions

Why does < need to be encoded in HTML?

A raw < is interpreted as the start of an HTML tag; encoding it as &lt; tells the browser to display the character itself instead of treating it as markup.

About this tool

ToolBench runs this tool entirely in your browser. Your file or text is processed on your own device using JavaScript — nothing is uploaded to a server, nothing is stored, and there's no sign-up wall between you and the result. That's true of every one of the 500+ tools on this site, from PDF utilities to unit converters.

More developer tools

View all developer tools