HTML Encoder
Convert special characters to HTML entities so text displays safely in web pages.
All conversions happen in your browser. No data is sent to our servers - see why that matters. Share links encode your input in the URL itself; nothing is stored on a server. Press Cmd/Ctrl + Enter to convert.
How to HTML Encode Text
Paste your text into the input panel. Special characters are replaced with their HTML entity equivalents so the text can be safely embedded in any HTML document.
What are HTML Entities?
HTML entities are escape sequences that represent reserved characters: they start with & and end with ;. For example, < renders as < without being interpreted as the start of a tag.
Common Use Cases
Encode HTML when displaying code snippets on a web page, inserting user-generated content into templates, writing documentation that shows raw markup, or preparing text for CMS fields.
Frequently Asked Questions
Which characters are encoded?
The five characters that are unsafe in HTML: & becomes &, < becomes <, > becomes >, double quotes become ", and single quotes become '.
Why encode HTML entities?
If user input or code samples are inserted into a page without encoding, browsers interpret < and > as tags - breaking the layout or enabling cross-site scripting (XSS) attacks.
Is this the same as URL encoding?
No. HTML encoding uses entities like & for display inside HTML documents, while URL encoding uses percent-escapes like %20 for use inside URLs. Use the right one for each context.
Does this handle Unicode characters?
Unicode characters like é or emoji do not need encoding in modern UTF-8 pages, so the tool leaves them intact and only escapes the structurally unsafe characters.