This HTML entity encoder turns characters like <, >, & and quotes into HTML entities, and it can decode entities back into readable text. It is made for anyone who wants to show code on a web page or place special characters safely inside HTML. It is free and runs in your browser.
How do you use the HTML entity encoder?
The tool has three simple steps, and you do not need an account.
- Choose encode or decode. Pick encode if your text contains characters such as < or &. Pick decode if your text already contains entities like
<and you want it readable again. - Paste your text. Add a snippet of code, a sentence, or a whole block of markup.
- Copy the result. Paste it straight into your page, template or editor.

Related jobs are one click away: try the URL Encode / Decode, the HTML / CSS / JS Minifier or the HTML / CSS / JS Beautifier.
There is also an option to encode non-ASCII characters. Turn it on when you want letters and symbols outside basic ASCII, such as accented letters or the copyright sign, converted too.
What are HTML entities and why do they matter?
An HTML entity is a short code that stands for a character. Browsers read it and display the real character. This matters because some characters have a special job in HTML. If you type a raw < in your content, the browser may think a tag is starting.
Converting special characters to HTML entities tells the browser to show the symbol instead of treating it as code. Here are the most common ones.
| Character | Entity | Why it needs care |
|---|---|---|
| < | < | Starts an HTML tag |
| > | > | Ends an HTML tag |
| & | & | Starts every entity |
| " | " | Can end an attribute value early |

What is this tool good for?
- Showing code in a blog post or tutorial. Encode a snippet such as
<div class="box">so readers see the tag instead of an empty box. - Writing documentation. Help pages and README-style content often include markup examples that must display as text.
- Putting quotes inside attributes. A double quote inside a
title="..."value can cut the attribute short. Encoding the quote avoids that. - Cleaning up copied text. If you find a page full of
&and<, the decoder turns it back into plain text. - Preparing content for templates and emails. Text with ampersands or angle brackets is safer once it has been encoded.
Tips for better results with an HTML entity encoder
- Encode once, not twice. If you encode text that is already encoded,
<becomes&lt;, and your page will show the entity itself. Decode first if you are unsure. - Encode only the part that needs it. If you paste a full page, every tag becomes text. Encode just the snippet you want displayed.
- Use the non-ASCII option when your destination is picky. Some older systems and email tools handle accented letters badly. If your page already uses UTF-8, you can usually leave the option off.
- Test in a preview. After pasting the result, check how it looks in the browser. A quick look catches double-encoding right away.
- Keep the original. Save your unencoded text somewhere. It is much easier to edit than a wall of entities.
Should you encode or decode?
Use this quick guide if you are not sure which mode to choose.
| Your situation | Mode |
|---|---|
| You want code to appear as visible text on a page | Encode |
| Your text has raw &, < or quotes that might break HTML | Encode |
You copied text full of & or " | Decode |
| You want to read or edit entity-filled source text | Decode |
Common problems and how to fix them
My page shows < instead of a bracket
The text was encoded twice, or an entity was placed somewhere that already encodes it. Run it through the decoder once, then encode it again only if you still need to.
My code snippet disappears on the page
The browser read your tags as real HTML. Encode the snippet so the brackets display as text.
Accented letters look broken
This usually points to a character encoding mismatch between your file and your page. Encoding non-ASCII characters is one way to sidestep it.
Decoded text still looks odd
Check whether the source was encoded more than once. A second decode pass may be needed to reach plain text.
If you only need an HTML entity decoder, choose decode and paste your text. The same page handles both directions, so you can switch back and forth while you work.
