jsondecode.com logo

HTML Entity Encoder

Convert special characters to HTML entities for safe use in HTML markup. Runs entirely in your browser.

Input
HTML Entity Encoded Output

What is HTML Entity Encoding?

HTML entity encoding replaces characters that have special meaning in HTML with their entity equivalents. For example, < becomes &lt; and & becomes &amp;. This prevents browsers from interpreting the characters as HTML tags or attributes.

HTML entity encoding is essential for XSS (Cross-Site Scripting) prevention when displaying user-supplied content in a web page. Always encode untrusted text before inserting it into HTML.