In shortEncoding turns special characters into HTML entities (< becomes <, & becomes &) so code displays as text instead of running; decoding does the reverse. Paste text and click Encode or Decode.
How to use the HTML encoder / decoder
- Paste text. Paste the HTML or text you want to convert.
- Pick Encode or Decode. Encode escapes special characters; Decode turns entities back into characters.
- Adjust options. Encode all non-ASCII characters, use numeric entities, or convert new lines to <br>.
- Copy the result. Copy it, download it, or swap it back into the input.
When do you need to encode HTML?
Browsers treat < as the start of a tag and & as the start of an entity. To show HTML code on a page — in a tutorial, a blog post or a documentation site — those characters must be written as entities, otherwise the browser runs the code instead of displaying it. Encoding user input before inserting it into a page is also the basic defence against cross-site scripting (XSS).
The five characters that matter
| Character | Entity | Why |
|---|---|---|
& | & | Starts every entity |
< | < | Starts a tag |
> | > | Ends a tag |
" | " | Ends a double-quoted attribute |
' | ' | Ends a single-quoted attribute |
Every other character (é, €, emoji) can be typed directly as long as the page declares <meta charset="utf-8">. Tick Encode all non-ASCII characters only for systems that can't handle UTF-8. For a searchable list see the HTML character codes reference.
Decoding
Decoding turns <p> back into <p> and handles every named entity (é), decimal (é) and hex (é) form — useful for reading escaped HTML from JSON, databases, RSS feeds and email sources.
Private by design: this tool runs entirely in your browser. Nothing you paste or open is uploaded to a server.
Frequently asked questions
What is HTML encoding?
Replacing characters that have special meaning in HTML (< > & " ') with entities like < so they display as text instead of being interpreted as markup.
How do I show HTML code on a web page?
Encode it here, then paste the result inside <pre><code> … </code></pre>. The browser will display the tags instead of rendering them.
What's the difference between &amp; and &#38;?
Nothing visible — both produce &. The first is a named entity, the second numeric. Numeric entities work for every Unicode character.
Is HTML encoding the same as URL encoding?
No. URL encoding uses % codes (space → %20) for URLs; HTML encoding uses &…; entities for page content.
Does decoding run any scripts?
No. Decoding uses an inert text area, so nothing in the input can execute.