Mode
Input
Output (click to copy)
Frequently Asked Questions
What is HTML encoding?
HTML encoding (also called HTML escaping) replaces special characters with their HTML entity equivalents. < becomes <, > becomes >, & becomes &, " becomes ". This prevents HTML injection and displays characters correctly in web pages.
When do I need to HTML encode?
When displaying user-submitted content in a web page, when inserting text into HTML attributes, when showing code examples on a website, and whenever you need to prevent characters from being interpreted as HTML tags.
What are HTML entities?
HTML entities are codes that represent characters that have special meaning in HTML or that aren't easily typed. Examples: < (less than), > (greater than), & (ampersand), © (©), — (—), © (numeric for ©).
What is the difference between encoding and escaping?
Encoding and escaping are used interchangeably in web development. Both mean converting characters to their safe HTML representation. Some developers reserve 'encoding' for character set conversion (UTF-8) and 'escaping' for HTML entity replacement, but in practice the terms overlap.