<

HTML Entity Encoder

Encode and decode HTML entities. Escape or unescape special characters for safe HTML output.

How to Use

  1. Paste HTML code or plain text containing special characters into the input area. Choose Encode mode to convert reserved characters into their HTML entity equivalents for safe embedding in HTML source.
  2. The tool converts ampersand, less-than sign, greater-than sign, double quote, and single quote into their named HTML entities.
  3. Use Decode mode to reverse the process — convert HTML entities back to their original characters. Copy the output with one click.

Frequently Asked Questions

What characters does this tool encode?
It encodes the 5 reserved HTML characters: ampersand, less-than, greater-than, double quote, and single quote. These must be escaped to avoid breaking HTML structure.
When should I use HTML entity encoding?
Use encoding when embedding user-generated content in HTML to prevent XSS attacks, or when displaying code snippets where you want literal characters to show rather than be interpreted by the browser.
What is the difference between named and numeric entities?
Named entities use mnemonic names like amp for ampersand. Numeric entities use Unicode code points. Both produce the same visual result — named entities are more readable.