HTML Encode Online
Escape special characters so text is safe to show in HTML. Turn & < > and quotes into entities, and optionally convert accented letters, symbols and emoji to named, decimal or hex entities.
How to use HTML Encoder on KickSolve
Three quick steps, no account needed.
Why choose KickSolve
Built for speed, privacy and clean results.
What you can do with HTML Encoder
Everything this tool offers.
About HTML Encoder on KickSolve
What it does and how to get the best results.
What is HTML encoding?
HTML encoding replaces characters that have special meaning in markup, or that are hard to type, with entities that start with an ampersand and end with a semicolon. A browser displays the entity as the original character instead of treating it as code.
Which characters must be escaped?
At minimum, the ampersand, less-than and greater-than signs, and quotes inside attribute values. Everything else is optional when your page uses UTF-8, but entities are useful for ASCII-only systems or for characters you cannot type.
Named, decimal or hex?
Named entities such as © are readable but exist only for a limited set of characters. Decimal (©) and hex (©) numeric entities work for any Unicode character, including emoji.
A note on security
Encoding output is a core defence against cross-site scripting, but it must match the context: HTML text, attribute, JavaScript or URL. Prefer your framework's built-in escaping and treat this tool as a helper for content you paste by hand.
Read the KickSolve privacy policy for details about the site itself.
Characters that must be escaped in HTML
These five have special meaning in markup.
| Character | Entity | Why |
|---|---|---|
| & | & | Starts an entity |
| < | < | Starts a tag |
| > | > | Ends a tag |
| " | " | Ends a double-quoted attribute |
| ' | ' | Ends a single-quoted attribute |
Encoding example in each mode
Input: <a href="/cafe">Café & "Co"</a> © 2026 — 5 < 6
| Mode | Result |
|---|---|
| Special only | <a href="/cafe">Café & "Co"</a> © 2026 — 5 < 6 |
| Named | <a href="/cafe">Café & "Co"</a> © 2026 — 5 < 6 |
| Decimal | <a href="/cafe">Café & "Co"</a> © 2026 — 5 < 6 |
| Hex | <a href="/cafe">Café & "Co"</a> © 2026 — 5 < 6 |
Frequently asked questions
Quick answers.
What does HTML encode mean?
It replaces special characters such as < and & with entities such as < and & so the browser shows them as text.
Which characters need to be HTML encoded?
The ampersand, less-than and greater-than signs, and quote characters inside attributes.
What is the difference between named and numeric entities?
Named entities use a word such as é. Numeric entities use the Unicode number in decimal (é) or hex (é). Numeric works for every character.
How do I encode an apostrophe?
Use ' for the widest compatibility, or ' if you turn that option on. ' is valid in HTML5 and XML.
Do I need to encode accented letters or emoji?
Not if your page is UTF-8, which is the default today. Do it for ASCII-only systems or when you cannot control the file encoding.
Does encoding prevent XSS?
It is an important part of defence when done correctly for the right context, but it is not sufficient alone. Use framework escaping and a content security policy.
Does the encoder change line breaks or spaces?
No. Spaces and line breaks are kept as they are.
Is the HTML encoder free and private?
Yes. It is free with no signup and runs in your browser.
How do I decode HTML entities back to text?
Use the HTML decoder, which turns named, decimal and hex entities back into characters.
More free tools from KickSolve
Related everyday tools.