HTML Entity Encoder / Decoder
Convert special characters to HTML entities and back — named, decimal, or hexadecimal. Live rendered preview. Nothing uploaded, nothing logged.
Guide
How to encode or decode HTML entities
- 1 Choose your mode
Toggle between Encode (characters to entities) and Decode (entities back to characters). Encode is the default.
- 2 Paste or type your text
Enter content in the left pane. Conversion is automatic — no button needed.
- 3 Select an entity format
In Encode mode, choose Named, Decimal, Hexadecimal, or All Characters to control the output form.
- 4 Check the preview
The preview renders the decoded output in a sandboxed iframe — scripts never execute.
- 5 Copy the output
Click Copy or press Ctrl+Shift+C. A confirmation toast shows for 1.5 seconds.
- 6 Go fullscreen
Click Fullscreen or press F for a three-column workspace with more room.
Reference
HTML entity format comparison
| Character | Named | Decimal | Hex | Use when |
|---|---|---|---|---|
| < (less-than) | < | < | < | Always in HTML content |
| > (greater-than) | > | > | > | Always in HTML content |
| & (ampersand) | & | & | & | Always — prevents parser ambiguity |
| " (double quote) | " | " | " | Inside double-quoted attributes |
| ’ (apostrophe) | ' | ' | ' | Inside single-quoted attributes |
| © (copyright) | © | © | © | Named for readability |
| — (em dash) | — | — | — | Named for readability |
Pitfalls
Common HTML encoding mistakes
-
Double-encoding escaped content
Running &amp; through the encoder again produces &amp;amp;. Decode first, then re-encode.
-
Encoding inside script or style
Entity encoding applies to text nodes and attributes — not content inside <script> or <style> tags.
-
Using &apos; in HTML4
&apos; is valid in XML and HTML5 but undefined in HTML4. Use ' for older parsers.
-
Omitting the trailing semicolon
Named entities need a semicolon (&amp; not &amp). Without it, browser behaviour varies.