How to use the HTML Entity Encoder
Choose whether to Encode (convert special characters to HTML entities) or Decode (convert entities back to characters). Paste your text and the result appears instantly. Click Copy to grab the output.
Frequently Asked Questions
HTML entities are codes that represent special characters in HTML. For example the less-than sign < is written as < in HTML code to prevent the browser treating it as the start of a tag. Common entities include & for &, © for © and for a non-breaking space.
If you include characters like <, >, & or quotes directly in HTML they can break the page or cause security vulnerabilities like XSS (cross-site scripting). Encoding them ensures they display correctly and safely.
HTML encoding converts characters for use inside HTML documents. URL encoding (percent encoding) converts characters for use in web addresses, replacing spaces with %20 for example. They use different codes for the same characters.
Inside HTML attributes wrapped in double quotes you do not need to encode single quotes, and vice versa. However encoding both as ' and " is safer and more compatible across all contexts.