HTML Entity Encoder / Decoder

Encode special characters to HTML entities or decode entities back to text. Free.

50 free uses every 24 hoursUnlimited with Pro →

Private by design — your data stays on your deviceEverything runs right here in your browser. What you type is not sent to our server and is not stored.
  • Runs in your browser
  • Not stored
  • No sign-up

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.

  1. Choose encode or decode. Pick encode if your text contains characters such as < or &. Pick decode if your text already contains entities like &lt; and you want it readable again.
  2. Paste your text. Add a snippet of code, a sentence, or a whole block of markup.
  3. Copy the result. Paste it straight into your page, template or editor.
How to use the HTML Entity Encoder / Decoder on OneHubTools: 3 steps with a real screenshot of the tool
How to use the HTML Entity Encoder / Decoder, step by step.

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.

CharacterEntityWhy it needs care
<&lt;Starts an HTML tag
>&gt;Ends an HTML tag
&&amp;Starts every entity
"&quot;Can end an attribute value early
Result from the HTML Entity Encoder / Decoder on OneHubTools
What the HTML Entity Encoder / Decoder gives you.

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 &amp; and &lt;, 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, &lt; becomes &amp;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 situationMode
You want code to appear as visible text on a pageEncode
Your text has raw &, < or quotes that might break HTMLEncode
You copied text full of &amp; or &quot;Decode
You want to read or edit entity-filled source textDecode

Common problems and how to fix them

My page shows &lt; 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.

Limits and specs

PriceFree
Free use50 uses every 24 hours — shared with 178 other tools in the “Basic tools” group
Where it runsIn your browser
Sign-upNot needed
Muhammad Shahwaiz Gillani
Maintained and reviewed by Muhammad Shahwaiz GillaniSoftware engineer and founder of OneHubTools · Last reviewed

How we checked it: We tested it in Chrome with real code and data, including edge cases such as empty input and very long values.

Sources

According to MDN Web Docs, HTML is the standard markup language that defines the structure of every web page, and it was created more than 30 years ago.

Spotted a mistake or the tool did not work for you? Tell us and we will fix it.

Rate this tool

Ratings come only from signed-in users, so every rating is verified.

Only signed-in users can rate tools, so every rating shows a ✔ Verified badge.Sign in to rate

Frequently asked questions

What does an HTML entity encoder do?

It replaces special characters like <, >, & and quotes with entity codes that browsers display as the original characters. This lets you show code or symbols on a web page without the browser treating them as markup.

How do I decode HTML entities back to normal text?

Choose decode, paste your text, and copy the result. Entities such as &lt; and &amp; are converted back into the characters they stand for.

Which characters should I encode in HTML?

At minimum, encode <, >, & and quotes when they should appear as text. These are the characters that most often break markup or attributes.

What does the non-ASCII option do?

It also converts characters outside basic ASCII, such as accented letters and symbols, into entities. Use it when your destination may not handle those characters correctly.

Why do I see &amp;lt; on my page?

The text has been encoded twice. Decode it once to get back to the original, then encode it again only if needed.

Is this HTML entity tool free, and is my text uploaded?

Yes, the tool is free to use. It runs in your browser, so you can paste your text and convert it right on the page.