๐ท๏ธ HTML Entity Encoder
Turn characters such as < > & into HTML entities, or decode entities back to text.
Common entities:
&&
<<
>>
""
''
ยฉ©
ยฎ®
โข™
โฌ€
ยฅ¥
About HTML entity encoding
HTML entities represent reserved or hard-to-type characters with short codes: < for <, & for &, and " for a double quote. Encoding is useful when you need to display markup as text instead of letting the browser parse it.
This tool encodes and decodes entirely in your browser; nothing is uploaded. Use it to escape a snippet for a tutorial, inspect an API response, or turn a string full of entities back into readable text.
How to use it
Choose Encode or Decode, paste your text, then click Convert. Copy the result when it looks right.
- Encode turns <, >, & and quotes into entities.
- Decode turns <, >, & and similar entities back into characters.
- Conversion happens locally and clears when you refresh the page.
Common uses
- Display HTML snippets in documentation, tutorials or blog posts.
- Escape user text before inserting it into an HTML text node.
- Debug double-escaped output from APIs, email templates or a CMS.
FAQ
- What is the difference between named and numeric entities?
- Named entities such as & are readable and cover common characters. Numeric entities such as & or & can represent any Unicode code point. Browsers render both the same way.
- Does encoding prevent XSS?
- Entity encoding only applies to HTML text context. It is not a full output-escaping or input-validation strategy; use the escaping rules for attributes, URLs and JavaScript when you place data there.
- Why do I still see & after decoding?
- The source was probably encoded twice. Make sure the input is a single layer of entities, then decode once; avoid encoding the same content repeatedly.