Choose Encode and paste the text you want to display literally inside HTML. The output replaces special characters with entities so a less than sign is displayed as text rather than interpreted as the start of a tag. Try the example below, then copy the result into a text content position in your document. Choose Decode when you need to inspect an existing entity encoded string.
The encoder also handles quotation marks and several punctuation characters; it is not a complete sanitizer for arbitrary HTML, script, style, or URL contexts. Decide where the result will be inserted before using it. Encoding an already encoded value encodes its ampersands again, so keep track of which layer owns escaping. Use the swap control only when you intend to reverse the current transformation.
Encode input: <b>&
Output: <b>&
Decode input: <b>&
Output: <b>&
HTML encoding converts special characters like <, >, &, and " into their HTML entity equivalents (<, >, &, "). This prevents browsers from interpreting these characters as HTML markup, which is essential for security (preventing XSS attacks) and for displaying code snippets correctly on web pages.
Named entities use descriptive names like & for & and < for <. Numeric entities use character codes like & (decimal) or & (hexadecimal) for &. Both produce the same result, but named entities are more readable while numeric entities support a wider range of characters.
Processing runs in your browser. Choosing Share uploads the selected tool state; anyone with the link can open it. Signing in to save sends content to your account library and records save history. Review the selection before either action. Closing the page does not delete those copies. Copying locally does not create a server share.
Use HTML encoding when displaying user-generated content on web pages, embedding code snippets in HTML, working with form data, creating email templates, or any time special characters might be misinterpreted as HTML markup.