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.

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.

Output

                

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.