HTML Entity Encoder
Escape ampersands, angle brackets, and quotes into HTML entities, or encode every printable character at once. Safe for HTML, email, and JSON payloads.
How to use
- Type or paste the text to encode.
- Turn on encoding everything to escape every printable character as a numeric entity.
- Copy the result.
HTML entity encoding escapes the characters that have special meaning in markup, so text can be placed inside an element or an attribute without being read as HTML.
Paste or type something above.
Questions about html entity encoder
- Which characters need escaping?
- The ampersand, both angle brackets, the double quote, and the apostrophe. Everything else is safe as plain text.
- When do I need to escape everything?
- When the text has to survive being embedded in a context you do not control, such as generated markup or an email body.
- Why is the ampersand escaped first?
- Because escaping it after the others would double-escape the ampersands those escapes introduce.
Related tools
- HTML Entity Decoder Turn named and numeric HTML entities back into the characters they represent, covering com...
- String Escape Tool Escape and unescape a string for JSON, JavaScript, URL, or SQL, covering backslashes, quot...
- Unicode Converter Convert text to Unicode escapes and back, covering code points beyond the basic multilingu...