HTML Entity Encoder
Escape special characters so they display safely as text in HTML.
What this tool does
Some characters have special meaning in HTML, so writing them literally can break a page or display incorrectly. This tool converts characters like <, > and & into their safe entity forms — and back again.
How to use this tool
- 1
Choose the direction
Encode when you need text to display as text; decode when you are reading markup that was escaped.
- 2
Paste the content
For encoding, paste the raw text or HTML fragment.
- 3
Copy the result
The escaped version is safe to place between tags.
When to use it
- You want to display code or a tag as visible text on a web page.
- You are inserting user text into HTML and need to escape it safely.
- You received entity-coded text and want to read it normally.
- You are debugging content that renders as symbols instead of characters.
How to understand this tool
A browser treats < and & as the start of markup, so text containing them has to be escaped or it gets parsed as tags. The common ones are < > & " and '. This is a display fix only: escaping output is not enough to make user input safe on a server.
What it will not do
- It does not sanitise input or strip scripts.
- Decoding twice can turn already-safe text back into markup, so check before pasting into a page.
Questions people ask
Why encode < and >?
Left and right angle brackets start HTML tags. Encoding them lets you show the symbols as text instead.
Is this enough to make user input safe?
Escaping is important, but full safety also depends on context and other protections. Do not treat this as complete sanitisation.
One thing worth knowing
Encoding is not encryption. It changes representation, not confidentiality — never use it to hide sensitive data.