How to Encode or Decode HTML Entities
Pick the Encode or Decode tab
Use the Encode tab to turn raw characters such as &, <, > and quotes into safe entities, or the Decode tab to turn existing entities back into plain characters. Switching tabs clears both boxes so you start from a clean slate.
Type or paste into the Input box
Drop your snippet into the Input area. The conversion runs as you type and stays on your device, so there is no upload step and no button to press to see results.
Copy or clear the result
The converted text appears instantly in the Output box. Press Copy Result to send it to your clipboard, or Clear to empty both boxes and convert something else.
What Each Mode Converts
The encoder targets the five characters that can break markup or open injection holes, while the decoder reverses entities back to readable text. The table below shows exactly what this tool transforms in each direction.
| Character or entity | Encode output | Decode input it accepts |
|---|---|---|
| Ampersand (&) | & | & |
| Less-than (<) | < | < |
| Greater-than (>) | > | > |
| Double quote (") | " | " |
| Single quote (') | ' | ' or ' |
| Symbols (copyright, dashes, nbsp) | Left as-is | © ® ™ — – and more |
When to Reach for This Tool
Displaying code in HTML
Encode a snippet before placing it inside a page so that tags render as visible text instead of being parsed as real markup.
Sanitizing user input
Encoding the five reserved characters is a core defense against breaking your layout and against script injection when echoing untrusted text.
Reading scraped or escaped content
Use Decode to turn entities like & or numeric codes such as © back into plain characters so you can read or reuse the original text.
Quick one-off conversions
For a single string you do not need a library or build step. Paste it, read the live output, and copy the result in a couple of clicks.
Common Problems and Fixes
An entity stayed unchanged after decoding
The decoder recognizes a fixed set of named entities (such as &, <, © and —) plus any decimal NN; or hex NN; code. Less common named entities are left untouched on purpose; convert them to their numeric form first if you need them decoded.
My single quotes became ' not '
This is expected. The encoder always outputs the numeric ' for single quotes because it is supported everywhere, including older HTML. The decoder accepts both ' and ' and turns either back into an apostrophe.
Switching tabs wiped my text
Changing between Encode and Decode clears both boxes so the two modes never mix. Copy any output you want to keep before switching, then paste it back into the Input box.
Nothing happens when I press Copy
Copy Result only works when the Output box has content, and clipboard access requires a modern browser. If the button does nothing, confirm there is output and select the text manually as a fallback.