HTML Encoder / Decoder
Our free HTML encoder / decoder converts text between plain characters and HTML entities in real time. Paste text with special characters such as &, <, or © into the Decoded box and we instantly produce safe HTML code in the Encoded box. Paste entity code into the Encoded box and we translate it back to readable text. There is no button to press, no signup, and no limit on how much text you can convert.
Decoded
Encoded
What Is HTML Encoding?
HTML reserves a handful of characters for its own syntax. The angle brackets open and close tags, the ampersand starts entity references, and quotes delimit attribute values. If you place these characters directly in content, a browser may parse them as markup instead of displaying them. HTML encoding replaces each reserved or unsupported character with a character reference the browser renders as the literal symbol.
Every reference takes one of three forms: a named reference like <, a decimal numeric reference like <, or a hexadecimal numeric reference like <. All three display the same less than sign. Numeric references point straight at a Unicode code point, which is why they can represent any character, including emoji and ancient scripts that have no named entity at all.
How to Use Our HTML Encoder / Decoder
Encoding Text to HTML Entities
- Click into the Decoded box on the left and type your text, or use the paste icon to insert your clipboard content in one click.
- Watch the Encoded box on the right fill automatically. The copyright symbol becomes
©and a less than sign becomes<, while plain letters and numbers pass through. - Adjust the two checkboxes under the boxes if you need a different output style. The next section explains each option.
- Not sure what to test? Click the example chip, Foo © bar 𝌆 baz ☃ qux, to test symbols and rare Unicode characters at once.
- Take your result with the copy icon, or export it as a .txt file or Word document.
Decoding HTML Entities Back to Text
- Paste your entity code into the Encoded box on the right, such as a string copied from page source or an API response.
- Read the plain text result in the Decoded box. We resolve named, decimal, and hexadecimal references in the same pass.
- Fix double encoded text by running it through twice:
&#169;becomes©, then the copyright symbol itself. - Copy the cleaned text with the copy icon, or clear both boxes with the erase icon.
The History of HTML Character Entities
Character entities are older than the web. They come from SGML, the document standard published as ISO 8879 in 1986, which shipped named entity sets for Latin, Greek, and Cyrillic publishing. When HTML 2.0 was formalized in RFC 1866 in 1995, it borrowed a small subset of those SGML names, including the still familiar , ©, and ®.
HTML 4.01, released in 1999, expanded the list to 252 named entities covering Latin 1 characters, Greek letters, and mathematical symbols. HTML5 then adopted the much larger XML entity definitions maintained by the W3C Math Working Group, growing the official list to more than 2,200 named references. Here is a detail most tool pages miss: ' for the apostrophe was never part of HTML 4.01, only XML, so it silently failed in older versions of Internet Explorer. That is one reason careful developers, and our default settings, prefer numeric codes such as '.
HTML Entity Reference Table
Copy any code below straight into your markup. This table covers the characters people encode most often; our tool handles every other Unicode character automatically.
| Character | Name | Named entity | Decimal | Hexadecimal |
|---|---|---|---|---|
| & | Ampersand | & | & | & |
| < | Less than | < | < | < |
| > | Greater than | > | > | > |
| “ | Double quote | " | " | " |
| ‘ | Apostrophe | ' (HTML5 only) | ' | ' |
| (space) | Non breaking space | |   |   |
| © | Copyright | © | © | © |
| ® | Registered | ® | ® | ® |
| ™ | Trademark | ™ | ™ | ™ |
| € | Euro sign | € | € | € |
| ° | Degree sign | ° | ° | ° |
| § | Section sign | § | § | § |
Who Uses an HTML Encoder / Decoder?
- Developers who need to display code samples on a page, so a literal
<div>shows as text instead of becoming a real element. - Bloggers and CMS editors who paste content from Word or Google Docs and end up with curly quotes and symbols that break in older themes or plugins.
- Email template builders, since many email clients handle numeric entities far more reliably than raw UTF 8 symbols.
- Technical writers preparing documentation that must show markup, commands, and comparison operators as visible text.
- Data feed maintainers who publish RSS and XML files, where an unescaped ampersand in a single product name can invalidate the whole feed.
- Students and QA testers decoding entity heavy strings copied from page source, logs, or API responses back into readable text.
Tool Features
- Live two way conversion between plain text and HTML entities.
- Default mode encodes only unsafe and non ASCII characters, keeping output compact.
- Optional named character references such as
©in place of numeric codes. - Separate character counters for the decoded and encoded text.
- One click paste, clear, and copy controls on both boxes.
- Export the encoded result as a .txt file or a Word document.
- A built in example string to test symbols and rare Unicode characters.
- Free to use with no account, watermark, or conversion limit.
FAQs
What does an HTML encoder do?
An HTML encoder replaces characters that have special meaning in markup, such as the ampersand and angle brackets, with character references like & and <. Browsers then display the literal symbols instead of parsing them as code, so your text renders exactly as written.
Is HTML encoding the same as URL encoding?
No. HTML encoding uses entity references such as & to display characters safely inside a web page. URL encoding uses percent codes such as %20 to transmit characters safely inside a web address. They protect different contexts, and each one has its own dedicated tool on our site.
Why do I see & or © on my web page?
Visible entity codes mean the text was encoded twice, or it was encoded and then never rendered as HTML. Paste the affected string into our Encoded box and we convert it back to normal characters, which you can then re insert into your page or template once.
Does HTML encoding prevent XSS attacks?
Encoding untrusted output for the HTML body is one widely recommended defense against cross site scripting, because injected tags display as harmless text. It is not sufficient on its own. Attributes, JavaScript, CSS, and URLs each require their own escaping rules, so use encoding as part of a broader security approach.
What is the difference between named and numeric references?
Named references use readable words, such as © for the copyright symbol. Numeric references use the Unicode code point in decimal or hexadecimal form, such as © or ©. All three render identically. Numeric codes offer the widest compatibility, while names are easier to read.
Do HTML entities always need a semicolon?
You should always include it. Browsers tolerate a few legacy names like © without the semicolon for backward compatibility, but the behavior is inconsistent and fails in XML. Our encoder always outputs complete references ending in a semicolon, so the result validates and renders reliably everywhere.
Is this HTML encoder / decoder free to use?
Yes. The tool is completely free, runs instantly in your browser, and requires no account or download. There is no limit on text length or number of conversions, and you can copy the result or export it as a .txt file or Word document at any time.