&
Advanced text tools Your privacy comes first

HTML Entity Encoder and Decoder

Escape special characters for HTML display or turn encoded entities back into readable text.

About this tool

HTML Entity Encoder and Decoder — HTML entities represent characters such as <, >, &, quotes, and non-breaking spaces without letting the browser treat them as markup.

Encoding is useful for displaying code samples; decoding helps inspect content copied from HTML or feeds.

How to use it

  1. Paste the source text or entity string.
  2. Choose Encode or Decode.
  3. Copy the result and test it in the intended HTML context.

Example

Before
<strong>Tom & Sara</strong>
After
&lt;strong&gt;Tom &amp; Sara&lt;/strong&gt;

Encoding text for display is not the same as sanitizing untrusted HTML.

Common uses

  • Display code examples on a webpage.
  • Inspect content received with HTML entities.
  • Prepare literal text for templates.

What to know

  • Escaping rules depend on whether data is placed in HTML, an attribute, CSS, or JavaScript.
  • Do not rely on entity encoding alone to remove malicious markup.

Privacy: The operation runs locally in your browser; your input is not uploaded by this tool.

Frequently Asked Questions

Does entity encoding sanitize unsafe HTML?+

Not by itself. Safe rendering depends on the output context and a proper escaping or sanitization strategy.

What is the difference between &amp; and &#38;?+

Both can represent an ampersand; one is a named entity and the other is numeric.

Will all Unicode characters be encoded?+

The tool focuses on characters that need or commonly use HTML entity representation.