Skip to main content
~/makemydev/html-encoder

$html-encoder

Encoders

Encode special characters to HTML entities or decode HTML entities back to text. Supports named entities (&) and numeric entities (&). Everything runs in your browser.

Mode:

Encodes & < > " and ' to named HTML entities. Use for escaping user content in HTML.

Output will appear here

Also converts non-ASCII characters (é, ñ, ü, etc.) to numeric entities. Use when the target charset is ASCII-only.

Output will appear here

HTML Entity Reference

CharacterNamedDecimalDescription
&&amp;&#38;Ampersand
<&lt;&#60;Less than
>&gt;&#62;Greater than
"&quot;&#34;Double quote
'&#39;&#39;Single quote / apostrophe
 &nbsp;&#160;Non-breaking space
©&copy;&#169;Copyright
&mdash;&#8212;Em dash

// how-to

How to encode and decode HTML entities

Convert characters like < > & " to their HTML entity equivalents to prevent injection and layout breakage.

  1. Paste the source

    Type or paste markup, user input, or already-encoded text into the input box.

  2. Encode or decode

    Switch direction. Encoding turns < into &lt;, and decoding does the reverse.

  3. Pick named or numeric

    Choose between named entities (&copy;) or numeric references (&#169;) depending on your target context.

  4. Copy the output

    Copy the encoded or decoded text straight to your clipboard.

// faq

? Which characters must I encode?
At minimum: < > & " '. Encoding these prevents accidental tag creation and attribute-breaking in HTML output.
? Is HTML encoding enough to prevent XSS?
No. HTML encoding helps for text content, but attributes, URLs, JavaScript, and CSS each need context-specific escaping.
? Numeric or named entity — which should I pick?
Named entities are more readable; numeric entities work in any XML parser. For HTML5, either is fine.