neatly done

HTML Encoder

Escape HTML special characters as entities so code can be shown on a web page. Encode only < > & and quotes, or other characters by name or number too.

  • Free
  • No sign-up
  • Works on phone and computer

How to encode HTML

  1. Paste your text or HTML.
  2. Choose which characters to encode.
  3. Copy the encoded HTML.

About this tool

To show HTML code on a page without the browser running it, the characters < > & and quotes must be replaced with entities such as &lt; and &amp;. Paste your text to do that. You can also turn other characters, such as é, € or Hindi letters, into named or numeric entities for systems that only accept plain ASCII.

Common questions

Which characters must be encoded?

The ampersand and the less-than sign always. The greater-than sign and quotes should be encoded too, especially inside attribute values. The default option encodes all five.

What is the difference between named and numeric entities?

Named entities like &eacute; are easier to read. Numeric ones like &#233; work for every character, including Hindi and emoji, which have no name. Characters without a name always use a number.

Why is the apostrophe &#39;?

It works in every version of HTML. The name &apos; is not understood by some older systems.

Is it free to use?

Yes. There's no sign-up, and you can use it as often as you like.

Is my text uploaded anywhere?

No. This tool runs inside your browser, so what you enter stays on your device.

Do I need to install anything?

No. It works in your browser on a computer or a phone.

You've reached today's free limit