Common HTML Entities
| Char | Named entity | Numeric entity | Description |
|---|---|---|---|
| < | < | < | Less-than sign (opens tags) |
| > | > | > | Greater-than sign (closes tags) |
| & | & | & | Ampersand (starts entities) |
| " | " | " | Double quote (in HTML attributes) |
| ' | ' | ' | Single quote / apostrophe |
| |   | Non-breaking space | |
| © | © | © | Copyright symbol |
| € | € | € | Euro sign |
How to Use It
1
Open the tool
Go to Database & Code and scroll to the HTML Entity Encoder.
2
Paste your text
Paste the text or HTML you want to encode or decode.
3
Choose direction
Click Encode to replace <, >, & etc. with entities. Click Decode to reverse.
4
Copy the result
Copy the output and use it in your HTML template, email or documentation.
Pro Tips
💡Always encode user-provided content before inserting it into HTML — this is one of the most important XSS prevention measures.
💡In JavaScript:
element.textContent = userInput is safe — the browser auto-encodes. Avoid innerHTML = userInput without encoding first.💡In templates (React, Vue, Angular), use the framework's built-in escaping. Only use raw HTML interpolation (
dangerouslySetInnerHTML, v-html) with sanitized content.Frequently Asked Questions
What are HTML entities?
Codes representing characters with special HTML meaning or that can't be typed directly.
< renders as < without starting a tag.Why encode HTML?
To prevent XSS attacks. If user input like
<script>... is displayed without encoding, it can execute JavaScript in the browser.Named vs numeric entities?
Both work identically. Named (
<) are more readable. Numeric (<) work for any Unicode character. Hex (<) uses hexadecimal.Does encoding affect SEO?
No — search engines decode entities to the underlying character before indexing.
< and < are treated identically.Encode HTML entities now
Open the HTML Entity Encoder and safely encode or decode special characters — free, instant, no login.
Open Entity Encoder →