CONVERTERS

HTML Entity Encoder & Decoder

Encode HTML-sensitive characters and decode common HTML entities.

CHARACTER REFERENCES

Convert entities locally

Browser-only
This encodes the five HTML-sensitive characters and decodes common named, decimal, and hexadecimal entities. It does not sanitize HTML or make untrusted markup safe to render.

HTML entity conversion happens in your browser and is never uploaded.

HTML entity guide

HTML entities are character references such as & and < that let HTML represent reserved characters. This tool encodes the five most important HTML-sensitive characters and decodes common named, decimal, and hexadecimal references.

It is a text conversion aid, not an HTML sanitizer. Never assume that encoding or decoding alone makes untrusted markup safe to insert into every context.

Why entities exist

The characters < and > have meaning in HTML markup, while & starts a character reference. Quoting them as &lt;, &gt;, and &amp; lets them appear as text instead of being interpreted as tags or references. Quotes are also commonly escaped inside attribute values.

Named and numeric references

HTML supports named references such as &quot; and &nbsp;, plus decimal references such as &#39; and hexadecimal references such as &#x27;. Numeric forms are useful when a named entity is unavailable or when preserving a code point explicitly.

Encoding is context-specific

HTML text, HTML attributes, URLs, JavaScript strings, and CSS each have different escaping rules. Use the encoder for HTML text and attribute values, then apply the escaping rules for the actual context in which the data will be inserted.

Frequently asked questions

Does this sanitize HTML?

No. It converts common character references only. Sanitizing untrusted HTML requires a context-aware, maintained sanitizer and safe rendering strategy.

What does &amp; represent?

It represents the ampersand character (&), which otherwise begins an HTML character reference.

Should I HTML-encode a URL?

Use URL percent-encoding for URL components. HTML-encode only when placing that URL inside HTML markup.

Related tools

Privacy note: HTML entity conversion happens in your browser. Your text is not submitted to NAB Tools.