Type a tool name, for example "keyword density" or "transcript".
Convert HTML characters to their encoded entity equivalents.
An HTML encoder converts characters that have special meaning in HTML, such as <, >, and &, into entities, so a browser shows them as visible text instead of reading them as markup. This free tool lets you paste code or upload a file, encode it in one click, then copy or download the result.
HTML encoding is the process of replacing reserved characters with entity codes that a browser displays literally. An entity starts with an ampersand and ends with a semicolon. For example, the less-than sign becomes <, and the browser prints a "<" on screen rather than starting a new tag.
HTML reserves a handful of characters for its own syntax. The angle brackets open and close tags, the ampersand starts an entity, and quotation marks wrap attribute values. If any of these appear in content you want to show as plain text, they have to be encoded first. Otherwise the browser may hide part of your text, break the layout, or run markup you never meant to include.
Encoding is also called escaping. It is not encryption. Anyone can reverse it, and it does not hide your source code from readers. Its only job is to make text safe to place inside an HTML document.
| Character | Entity | Why it needs encoding |
|---|---|---|
| < | < | Starts a tag |
| > | > | Ends a tag |
| & | & | Starts an entity |
| " | " | Closes an attribute value |
You can encode text in four short steps, and the same steps work for a single line or a whole page of markup.
To undo the process later, run the output through the HTML decoder, which turns entities back into readable characters.
Say you are writing a tutorial and want readers to see this line exactly as written:
<p>5 < 7 & 7 > 3</p>
If you paste it into your page as is, the browser treats the paragraph tags as real markup and gets confused by the bare ampersand and brackets in the middle. Paste it into the encoder with the checkbox off and click Encode. The result is:
<p>5 < 7 & 7 > 3</p>
Put that output inside a pre or code element and visitors will see the original line, tags and all. Every bracket and ampersand became an entity, while the letters, digits, and spaces stayed the same.
Now repeat the run with Encode all non-alphanumeric characters ticked. Every character that is not a letter or a digit, including spaces and punctuation, is converted. The output is much longer and harder for a human to read, but it contains nothing except letters, digits, and entity codes. That is useful when text passes through a system that mangles punctuation.
A good result is output where every reserved character has become an entity and the readable words around them are untouched. Scan the Encoded Result box for these patterns.
Each tag you wanted displayed should now start with < and end with >. If you see this, the text is ready to paste into the body of a page, a code sample, or a CMS field that renders HTML.
If the output matches your input, your text probably contained no reserved characters. Plain sentences with no brackets, ampersands, or quotes do not need encoding. Check that you pasted the right content.
Quotation marks only cause trouble inside attribute values, for example a title attribute that contains a quoted phrase. If your text will sit inside an attribute and the quotes look unchanged, run it again with the all non-alphanumeric option on, which converts every quote and apostrophe.
If the page shows &lt; where you wanted a bracket, you encoded text that was already encoded. Decode it once, then encode it once. Encode raw text exactly one time before it goes into HTML.
Anyone who displays code or untrusted text inside a web page benefits from encoding it first. These are the situations where it comes up most often.
& exists and how browsers parse reserved characters.If you only need to remove tags and keep the words, the strip HTML tags tool is a better fit than encoding.
Most encoding problems come from encoding at the wrong time or in the wrong place. A few habits prevent nearly all of them.
&amp;.If the output still renders as markup on your page, confirm you pasted the encoded text and not the original. If nothing appears after you click Encode, make sure the input box has content or that a file is actually selected. If you picked a file by mistake, remember it takes priority over the text box, so the text you typed will be ignored until the file selection is cleared by reloading the page.
This HTML encoder handles one conversion: characters to entities. It does not validate your markup, fix broken tags, or check whether your page is accessible. It also cannot decide for you which parts of a document should be encoded, so you choose the snippet.
Encoding does not change how search engines rank a page on its own. It helps indirectly. Code samples that display correctly keep your content readable, and a stray unescaped bracket will not cut a paragraph short in the rendered page. For full page editing, try the online HTML editor, and browse the web developer tools collection for related utilities.
Paste your snippet into the box above, click Encode, and copy or download the result. You will have text that displays exactly as you wrote it, with no surprises in the browser.
Your report has been submitted. We will look into this issue.
A VPN changes your network exit. It does not guarantee anonymity.
Themes, plugins, code, video, audio, graphics & more from 90,000+ authors.
Web Development
Design & Media
Unlimited Access
Explore Envato Market