GenerateIt

Encode / Decode HTML Entities

This tool also includes built-in HTML entity encoding, allowing you to safely display HTML source code on your webpage without it being rendered or executed by the browser. By encoding special characters, your code remains visible exactly as written, making it ideal for tutorials, documentation, blog posts, and educational examples.

HTML entities are used to represent special characters that would otherwise be interpreted as part of the HTML itself. Common characters such as angle brackets (< and >), quotation marks, and ampersands must be encoded to ensure they are displayed correctly as text. HTML entities are also useful for representing characters that are not available on a standard keyboard, such as accented letters, symbols, and mathematical characters.

Each HTML entity begins with an ampersand (&) and ends with a semicolon (;), ensuring the browser correctly recognizes and displays the intended character. By automatically handling this encoding for you, the tool helps prevent display issues, broken layouts, and unintended HTML rendering - making your source code clear, readable, and safe to share.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong.

Buy me a coffee

Your text is converted in your browser and is never sent anywhere.

How to use it

The encode / decode HTML entities is a great tool to use to help if you need to display HTML code on your webpage.

  1. Enter your codeEnter any HTML code into the top text area.
  2. Encode itOnce you click on ‘Encode’, the entered data will then be encoded so that it can be displayed on a webpage.
  3. Or decode itIf you would like to decode data, enter the text into the textarea and click on ‘Decode’.
  4. Copy the resultCopy the encoded or decoded output to the clipboard by clicking on ‘Copy’.
  5. Start againClicking on ‘Clear’ will clear all data in the input and output fields.

Tips

Showing code on a page

Paste your code, press Encode, then place the result inside a <pre><code> block so it shows exactly as written.

Accents and symbols

Choose ‘Named entities’ to turn letters like é and symbols like © into entities, handy for pages that are not saved as UTF-8.

Check your work

Use ‘Use result as input’ and then Decode to confirm you get your original text back.

Frequently asked questions

What is an HTML entity?

A short code that stands for a character, such as &lt; for < or &copy; for ©. It starts with an ampersand and ends with a semicolon. Browsers show the character instead of the code.

Which characters must always be encoded?

The ampersand, the angle brackets, and quotation marks (inside attribute values). If they are left as they are, the browser may read them as part of the page’s own HTML.

What do the encode options do?

“Special characters only” changes just & < > " and '. “Named entities” also changes accented letters and symbols to names such as &eacute;, and uses a number when a character has no name. The two number options turn every character outside basic ASCII into a decimal or hex code.

Why is the apostrophe encoded as &#39;?

The number form works in every version of HTML. The name &apos; is not valid in older HTML 4 pages.

Can it decode every entity?

Yes. Decoding uses your browser’s own HTML rules, so it understands all the named entities as well as decimal (&#169;) and hex (&#xA9;) codes.

Is it safe to paste HTML here?

Yes. Your text is treated as plain text, never as a web page, so nothing in it is run. It is also never sent to our server.

Related tools

Count Characters / Words

Online tool that will calculate how many characters, words and sentences that are in your text.

Case Converter

This online case converting tool will make it easier to change text from one format to another.

Form Generator

Online website form generator, this tool will take the guess work out of creating new contact forms for your website.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong.

Buy me a coffee