HTML Encoder / Decoder

Encode HTML special characters into entities or decode them back. Prevents XSS, handles &, <, >, quotes and unicode.

Free HTML Encoder & Decoder — Convert HTML Entities Instantly

HTML has reserved characters that have special meaning in markup — angle brackets (< >) define tags, ampersands (&) start entities, and quotes (") delimit attribute values. When you want these characters to appear as text on a page, they must be encoded as HTML entities. More critically, encoding user-generated content prevents Cross-Site Scripting (XSS) attacks. This free HTML Encoder converts any text to properly encoded HTML entities, and the decoder reverses the process.

Paste any text or HTML code to encode. Special characters are converted to their safe entity equivalents. Use the decoder to convert entity-encoded HTML back to readable text. Both directions work instantly with no data sent to any server.

HTML encoding is a critical web security practice. Displaying unencoded user input in HTML can allow malicious scripts to execute in other users' browsers — this is called Cross-Site Scripting (XSS), and it is one of the most common web vulnerabilities.

Common HTML Entity Reference

&lt; and &gt;. Encode the less-than and greater-than signs (< >). Essential when displaying code in HTML or any text containing angle brackets.

&amp;. Encodes the ampersand (&). Required in URLs within HTML attributes and any text where & appears.

&quot; and &apos;. Encode double and single quotes. Required inside HTML attribute values.

&nbsp;. Non-breaking space. Prevents line breaks between words and creates visible whitespace in HTML.

Special characters. Accented letters (é → &eacute;), trademark (™ → &trade;), copyright (© → &copy;), and hundreds of other characters have named HTML entities.

Related Tools

Frequently Asked Questions

What is HTML encoding?

Converts special characters to HTML entities so they display safely and cannot be interpreted as markup.

When is it needed?

Displaying user content in HTML, embedding code snippets, and preventing XSS security vulnerabilities.

Common entities?

&lt; &gt; &amp; &quot; &apos; &nbsp; &copy; — the most frequently used HTML entities.

Is this free?

Yes. Completely free, no account needed.