1. Home
  2. Developer tools
  3. HTML Entities

HTML Entities

Show code snippets on a web page safely, or turn entity-filled text back into readable characters.

Free, no sign-up. Runs in your browser: nothing is uploaded.

Free workspace included. Docs, spreadsheets, notes and tasks that save on your device. No sign-up.Take a look

How to use HTML Entities

  1. Paste text or HTML.
  2. Choose Encode or Decode.
  3. Copy the result.

Features

  • Named and numeric entities
  • Encode only special characters or all non-ASCII
  • Decode any entity

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the HTML Entities is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Encoding makes text safe inside HTML content. Inside JavaScript, CSS or URLs, text needs the escaping rules of that language as well.

Guide

HTML entities - when to escape text and how

Some characters have a special meaning in HTML. A < starts a tag, a & starts an entity, and a " can end an attribute. To show those characters as text, for example in a code sample, a blog post about HTML, or a product name like “R&D Tools”, they must be written as entities: &lt;, &amp;, &quot;. This tool converts text to entities and back.

Encoding text

  1. Choose Encode and paste your text.
  2. Pick which characters:
    • Only & < > “ ’: the minimum for correct HTML. Use this almost always.
    • Also all non-ASCII: additionally converts accented letters, symbols and emoji, for legacy systems and fragile email templates.
  3. Pick the entity style: named (&amp;, &copy;) or numeric (&#38;, &#169;).
  4. Copy the result into your HTML.
Character Named Numeric
& &amp; &#38;
< &lt; &#60;
> &gt; &#62;
“ &quot; &#34;
’ &#39; &#39;
© &copy; &#169;
non-breaking space &nbsp; &#160;

Characters that have no named entity, such as most emoji, are always written numerically.

Decoding text

Choose Decode and paste text full of entities, such as Tom &amp; Jerry&#8217;s &quot;Best&quot;. You get plain text back: Tom & Jerry’s “Best”. Decoding uses the browser’s own HTML parser, so every named and numeric entity is understood. Typical sources are RSS feeds, scraped pages, CMS exports and database fields that were escaped twice.

When you need it

  • Code samples in blog posts, documentation and tutorials: escape <div> so it appears as text.
  • User-visible text with ampersands or angle brackets in hand-written HTML or templates.
  • Attribute values containing quotes, such as title="The &quot;best&quot; tool".
  • Legacy and email HTML, where encoding non-ASCII characters avoids broken accents.
  • Cleaning data that arrives double-escaped, like &amp;amp;: decode until it reads correctly.

Escaping and security

Escaping text before inserting it into HTML is a core defense against cross-site scripting (XSS): an escaped <script> is displayed rather than run. But correct escaping depends on context: HTML text, attributes, URLs, JavaScript and CSS each have their own rules. In applications, rely on your framework’s automatic escaping (React, Vue, Django and most template engines do this by default) and use this tool for content, documentation and debugging, not as a sanitizer.

Do you need to encode accents?

On modern pages served as UTF-8 with <meta charset="utf-8">, you can write é, ñ, € and emoji directly. Encoding them only makes the source harder to read. Reach for all non-ASCII when a system mangles UTF-8, or when pasting into a template whose encoding you don’t control.

Who encodes HTML entities

  • Bloggers and technical writers show HTML code examples on web pages.
  • Developers escape text in templates and debug double-escaped data.
  • Email developers encode special characters for older email clients.
  • Content editors clean up text full of entities from feeds and exports.

A complete example: a code sample in a blog post

  1. Paste the HTML you want to show, such as <button class="primary">Buy</button>.
  2. Encode only the special characters.
  3. Paste the result inside a <pre><code> block in your post; readers see the code instead of a button.

Tips

  • Most blog editors and Markdown code blocks escape automatically; use this for hand-written HTML.
  • Decode text with entities like &amp;amp; until it reads normally.

Checked against the current version of the HTML Entities on .

Frequently asked questions

Which characters must be escaped in HTML?

In text, & and < always; > is recommended. Inside attribute values, also the quote character that wraps the attribute (" or '). Escaping all five, & < > " and ', is the safe default.

Named or numeric entities?

Both work in every browser. Named entities like &amp;copy; are easier to read; numeric ones like &amp;#169; work for every character, including those without a name, and in XML. Use whichever your team or system prefers.

Do I need to encode accented letters?

Not on modern pages saved as UTF-8 with a charset declaration; write é directly. Encoding all non-ASCII characters helps with old systems, some email templates and tools that mangle UTF-8.

Does escaping protect against XSS?

Escaping text before inserting it into HTML is one essential defense against cross-site scripting, but it's context-dependent - attributes, URLs, scripts and CSS need different handling. In real applications, use your framework's built-in escaping rather than manual conversion.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.