HTML Entity Encoder & Decoder
HTML entities let you display characters that would otherwise be interpreted as markup. Writing a literal < in HTML starts a tag; writing < displays the character instead. This tool converts in both directions.
Free, no signupRuns entirely in your browser
Input
Result
<div>Hello & Welcome</div>
About
What the HTML Entity Encoder & Decoder does
The four that always need escaping are < and > because they delimit tags, & because it starts an entity, and quotes when inside an attribute value. Escaping user-supplied content before rendering it is also the primary defence against cross-site scripting — if a submitted <script> tag is escaped, it displays as text instead of executing.
How it works
Using the HTML Entity Encoder & Decoder
- 1Paste your text or HTML.
- 2Choose encode or decode.
- 3Encoding replaces reserved and non-ASCII characters with numeric entity references.
- 4Decoding converts entity references back into the characters they represent.
- 5Copy the result into your page or editor.
Use cases
What people use it for
- Displaying a code sample on a web page without it rendering
- Escaping user input before inserting it into a template
- Decoding entity-heavy text from a CMS export or RSS feed
- Fixing text that shows &amp; instead of &
FAQ
Frequently asked questions
6 related
All tools →