HTML Entity Encoder & Decoder
Encode characters into HTML entities and decode entities back into characters.
Showing characters that HTML treats specially
Some characters mean something to HTML — the less-than and greater-than signs open and close tags, the ampersand starts an entity — so to display them as literal text you must encode them as entities, like < and &. This encodes text into HTML entities and decodes entities back, which you need whenever you want to show code or symbols on a page rather than have the browser interpret them.
Paste text to encode it, or paste entities to decode them.
Entities and safety
Encoding is also central to preventing a class of security bug: when you put user-supplied text into a page without encoding it, characters like the angle brackets can inject unintended HTML or script. Encoding those characters neutralises them, so they display as text instead of being executed. That is why frameworks encode output by default. Beyond safety, entities let you show any character reliably, including ones not on a keyboard, by their named or numbered code.
Frequently asked questions
Why encode characters as HTML entities?
So characters HTML treats specially — like angle brackets and ampersands — display as literal text instead of being interpreted as markup.
How does encoding relate to security?
Encoding user text before putting it in a page stops it injecting unintended HTML or script, which is a core defence against cross-site scripting.
Is my text uploaded?
No. The conversion happens in your browser.