Convert special characters to HTML entities and back.
Convert special characters like <, >, &, and " to their HTML entity equivalents (<, >, &, ") and back. Essential for displaying code snippets in web pages, preventing XSS vulnerabilities, and working with HTML content in any context.
If you put raw < or > characters in HTML, the browser interprets them as tags. Encoding them as < and > tells the browser to display the characters literally instead of parsing them as HTML. This is critical for showing code examples on web pages, preventing cross-site scripting (XSS) attacks, and ensuring special characters display correctly in all browsers.