Show tags and special characters in a tutorial without accidentally asking the browser to interpret them as markup.
You want a tutorial to display an HTML tag, but the browser treats it as part of the page. For example, an unescaped opening tag may change the layout instead of appearing as text. HTML entities help represent characters that would otherwise have a special role.
Distinguish the example from the surrounding markup
To show a less-than sign in HTML text, you can use <; a greater-than sign can be represented by >. The browser renders the character while preserving the intended text content.
This is useful for a tutorial showing a link or heading tag. It is a different task from URL encoding a query parameter, even though both involve representations of characters.
Convert and preview one example
- Open the HTML entity converter.
- Enter the short code example you want readers to see.
- Choose the applicable conversion and inspect the result.
- Place the encoded example into your HTML content.
- Preview the final page to ensure the tag appears as text.
If the page literally shows “amp;lt;” or another unexpected sequence, the example may have been encoded more than once, or the editor may be escaping it automatically. Check the editor's content mode before converting again.
Do not confuse a formatting utility with application security
Escaping depends on context. Text inside HTML, attributes, JavaScript and URLs has different requirements. A general entity conversion step is not a complete defense for inserting untrusted data into every possible context.
For ordinary documentation, keep the example small and test the rendered result. For application code, use the framework's supported escaping and sanitization mechanisms.
Try the converter for a documentation example. The Markdown workflow can help prepare the surrounding article, and a r37dy account supports your broader publishing and sharing workflow.