HTML Encode

Convert special characters to HTML entities.

Keep or share the finished result Copy or share after running the tool. Saved tools and settings stay in this browser.
More

HTML encode your text

Type or paste text above to convert characters that have a special meaning in HTML into their entity codes. The ampersand, the less-than and greater-than signs, and quotes are all escaped so the text can be shown on a page without being treated as markup. This helps prevent broken layouts and injection issues. It runs in your browser.

Why escape HTML

Escaping user text before placing it in a page keeps the browser from reading it as tags or attributes.

Frequently asked questions

Which characters get escaped?

The ampersand, the less-than and greater-than signs, and both quote characters are converted to their HTML entity codes.

Why would I encode HTML?

So text displays exactly as written rather than being interpreted as markup, which also helps avoid injection problems.