Encode Special Characters
Safely escape &, <, >, quotes and apostrophes so text displays exactly as written.
Encode special characters as HTML entities or decode entities back into readable text. Handles named entities like © and numeric ones like © in one step.
Everything runs in your browser, and decoding never executes any markup.
HTML entities are codes that represent characters with special meaning in HTML, or that are hard to type. For example, < stands for the less-than sign and © for the copyright symbol ©.
Encoding text before putting it in a web page stops characters like < and & from being read as markup. Decoding does the reverse, turning entities back into plain text.
Safely escape &, <, >, quotes and apostrophes so text displays exactly as written.
Optionally use named entities for common symbols such as the copyright sign, accented letters and the euro sign.
Convert any non-ASCII character, including emoji, to a numeric entity.
Decode named, decimal and hexadecimal entities back to text.
Decoding never runs scripts or loads images from your input.
Nothing is uploaded — all processing is local.
Paste text or HTML into the input box.
For encoding, pick essential characters, named entities or numeric entities.
Click Encode or Decode to see the result.
Copy it, or swap input and output to go back.
Quick answers about using the MoSanKit HTML Entity Encoder & Decoder.
At minimum, & and < in text, and quotes inside attribute values. > is usually encoded too for consistency.
Named entities use a short name, such as amp for the ampersand. Numeric entities use the character code number. Both display the same, and numeric entities work for every character.
Escaping output is one important defence, but correct escaping depends on where the text is placed. Use your framework's built-in escaping where possible.
Yes. A non-breaking space decodes to the actual non-breaking space character.
Names it does not recognise are left exactly as they are.
No. Encoding and decoding happen entirely in your browser.
Explore more free developer tools from MoSanKit.