HTML Entity Encoder
Encode special characters to HTML entities online — or decode entities back to text.
HTML entities let you display reserved characters safely — essential when showing code samples or user content in web pages.
How to use
- Paste text or HTML.
- Encode turns < > & into entities; Decode reverses it.
- Copy the result.
About this tool
Encoding prevents the browser from interpreting your text as markup.
Everything runs locally.
Use this page as an online HTML entity encoder for special characters: paste text containing &, <, >, double quotes or single quotes and Encode turns them into &, <, >, " and ', so the browser shows them as text instead of reading them as markup. For example, <p>Hello & "welcome"</p> becomes <p>Hello & "welcome"</p>. Decode does the reverse when copied markup arrives already entity-encoded.
How it works
In HTML, < > & " and ' are syntax. To show them as text you write entities: < > & " '. The browser renders <div> as the visible text <div> instead of creating an element.
Encoding user input before inserting it into a page is the basic defense against cross-site scripting (XSS). If a comment containing <script> is stored as <script>, the browser never executes it.
Named entities (&) are the readable option; numeric ones (& or &) can represent every Unicode character. Decoding reverses the process — handy when scraped pages arrive double-encoded.
To encode special characters online you do not need the full entity table — only five characters carry markup meaning. After encoding, check the output against the reference table below: every &, <, >, double quote and single quote in your input should appear as an entity, and everything else should pass through untouched.
Worked examples
Showing code in a blog post: To display <p>Hello</p> as text in your article, encode it to <p>Hello</p> — otherwise the browser swallows it as a real paragraph element.
Fixing double-encoded text: Seeing &amp; on a page means the text was encoded twice. Decode once to get &, decode again to get &.
Quick reference
| Character | Named entity | Numeric |
|---|---|---|
| & | & | & |
| < | < | < |
| > | > | > |
| " | " | " |
| ' | ' | ' |
| (non-breaking space) | |   |
Frequently asked questions
When do I need entities?
When displaying <, > or & as text in HTML, or sanitizing user input for display.
What is &?
The entity for an ampersand itself — entities can be nested.
Is my input uploaded?
No.
How do I encode special characters to HTML entities online?
Paste the text into the box and press Encode. The characters HTML treats as syntax — &, <, >, double quotes and single quotes — come out as &, <, >, " and ', ready to paste into a page where they should display as text.
Does this encoder change letters, numbers or symbols like ©?
No. It encodes only the five characters that have special meaning in HTML markup. Letters, digits and symbols such as © pass through unchanged — on a UTF-8 page you can normally use those characters directly.
First time embedding? Read the step-by-step guide →
More free tools
Base64 Encode / Decode
Encode text to Base64 or decode it back.
Color Converter (HEX ↔ RGB)
Convert HEX to RGB and back, with live preview.
Unit Converter
Convert length, weight and temperature instantly.
Currency Converter
Daily ECB reference rates for 26 currencies — updated once per business day.
World Clock & Time Converter
Current time in major cities, plus converter.
Meeting Time Planner
Find overlap hours across time zones.