Developer Tools

HTML Entity Encoder / Decoder

Encode special characters to HTML entities and decode HTML entities back to plain text.

Runs in your browser


            
Input length

Output length

Size increase

What is the Html Entity?

HTML entities are special codes used to represent characters that have meaning in HTML markup (like <, >, and &) or characters not easily typed on a keyboard. Encoding these characters prevents them from being interpreted as HTML tags, which is essential for security (preventing XSS attacks) and for displaying special characters correctly. This tool encodes plain text into safe HTML entities and decodes entities back to readable text.

How to use the Html Entity

  1. Paste the text you want to encode or decode into the input field.
  2. Choose Encode to convert special characters into their HTML entity equivalents.
  3. Choose Decode to convert HTML entities back into their plain-text characters.
  4. Select whether to encode all non-ASCII characters or only characters with special HTML meaning.
  5. Copy the processed result from the output field.

Frequently asked questions

Displaying user-supplied data without HTML encoding can allow Cross-Site Scripting (XSS) attacks, where malicious scripts injected into your page run in other users' browsers. Always encode untrusted input before rendering it as HTML.
Named entities use human-readable names (e.g., &copy; for ©). Numeric entities use a code point number in decimal (e.g., &#169;) or hexadecimal (e.g., &#xA9;). All three represent the same character.
Do not double-encode strings that are already encoded - you will end up with visible entity code in your output. Also, do not encode content inside script or style tags, which use their own escaping rules.