Free online text tool

HTML Entities Converter

HTML Entities Converter turns text into HTML entities. Type or paste your text, click the button and copy the result. It is free and runs in your browser.

HTML Entities Converter

0Character Count
0Character Count (without spaces)
0Word Count
0Sentence Count
0Paragraph Count
0Line Count

HTML Entities Example

Before
<title>This is a test title & code</title>
After
&lt;title&gt;This&nbsp;is&nbsp;a&nbsp;test&nbsp;title&nbsp;&amp;&nbsp;code&lt;/title&gt;

Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.

Suggest a New ToolProvide Feedback on This Tool

What does HTML Entities Converter do?

This tool converts text into HTML entities. An HTML entity starts with an ampersand and ends with a semicolon, such as &lt; for the less-than sign. Entities let you show characters like < and & on a web page without the browser treating them as code.

Type or paste your text and click the button. The characters &, < and > are always converted, and quotes are converted by default. By default spaces become &nbsp;, which keeps them from collapsing, and you can turn that off. You can also convert accents, symbols and emoji to numeric entities such as &#233;.

Line breaks are left as they are. The converted text can be pasted straight into your HTML.

HTML entities examples

Unless an option is named, spaces and quotes are converted, and accents, symbols and emoji are left as they are.

SettingBeforeAfter
Sentence with tags
<title>This is a test title & code</title>
&lt;title&gt;This&nbsp;is&nbsp;a&nbsp;test&nbsp;title&nbsp;&amp;&nbsp;code&lt;/title&gt;
Tags
<p>Hello</p>
&lt;p&gt;Hello&lt;/p&gt;
Ampersand
Tom & Jerry
Tom&nbsp;&amp;&nbsp;Jerry
Spaces kept as spaces
Tom & Jerry
Tom &amp; Jerry
Double quotes
<a href="x">
&lt;a href=&quot;x&quot;&gt;
Apostrophe
It's
It&#39;s
Quotes off
say "hi"
say "hi"
Accents, numeric
café
caf&#233;
Emoji, numeric
Hi 👋
Hi&nbsp;&#128075;

How to convert text to HTML entities

  1. 1
    Add your text
    Type or paste your text or code into the box, or import a text file.
  2. 2
    Choose the options
    Keep Change spaces to &nbsp; ticked to protect spaces, or untick it to keep normal spaces. Tick the last option for accents and emoji.
  3. 3
    Click Convert to Entities
    Your text is converted. Use Undo if you change your mind.
  4. 4
    Copy it
    Click Copy and paste the result into your HTML.

When to convert text to HTML entities

Good for

Showing HTML code, tags and special characters on a web page, blog post or tutorial so they appear as text and are not run as code, and for keeping characters safe inside HTML attributes.

Check first

Changing spaces to &nbsp; stops the browser from collapsing them, but it also stops lines from wrapping at those spaces. Untick that option if you only need to protect the code characters.

Other tools

To encode a web address, try Url Encode. To turn text into Base64, try Base64 Encoder. To see character codes as numbers, try String to Decimal.

HTML entities FAQ

What does the HTML Entities Converter do?

It converts text into HTML entities, so special characters such as < and & can be shown on a web page as text instead of being read as code.

How do I convert text to HTML entities?

Type or paste your text into the box and click Convert to Entities. The result appears in the same box, and you can copy it with the Copy button.

What is an HTML entity?

It is a code that starts with an ampersand and ends with a semicolon, such as &lt; for the less-than sign or &amp; for an ampersand. Browsers show the character instead of the code.

Which characters does it convert?

The characters &, < and > are always converted. Quotes are converted by default, spaces can be changed to &nbsp;, and accents, symbols and emoji can be changed to numeric entities.

Why are spaces changed to &nbsp;?

A browser collapses several spaces into one, and &nbsp; stops that. It is ticked by default, and you can untick it to keep ordinary spaces.

Why convert quotes?

Double quotes become &quot; and single quotes become &#39;. This keeps text safe when it is placed inside an HTML attribute, such as a title or alt value.

When should I convert accents and emoji?

Only if your page cannot use UTF-8 or you want plain ASCII output. For example, é becomes &#233; and a waving hand becomes &#128075;.

Can it convert entities back to text?

No, this tool only converts text to entities.

Is my text private?

The tool is free, needs no account and runs in your browser, so your text is not uploaded to a server.

Looking for more text tools?

Browse Conversion Tools

Last updated: 17 November 2026