HTML Entity Encoder and Decoder

Escape and unescape HTML special characters online. Paste text on the left, pick encode or decode, and see the converted result on the right in real time, all processed in your browser.

FreeOnline Tool
Loading…

How to Use

  1. Paste the HTML text you want to convert into the input box on the left.
  2. Choose the mode: encode (special characters to entities) or decode (entities back to characters).
  3. The result appears in the output box on the right in real time.
  4. Click "Copy" to put the result on your clipboard.

Features

  • Two-way conversion with a single switch between encoding and decoding.
  • Covers the common HTML entities as well as extended characters.
  • Responds as you type, so you can preview the result without pressing a button.
  • One-click copy of the output to speed up development.
  • Runs purely in the browser, so nothing is uploaded to a server.

Use Cases

Guarding against XSS in frontend code
Check the escaped output of user-submitted content before it is rendered, to confirm there is no injection risk.
Building email templates
Get the correct entities for quotes, angle brackets and similar symbols in HTML email so every mail client renders them properly.
Debugging CMS content
When CMS content shows double-escaping artifacts, decode it back to readable characters to pinpoint where the problem starts.
Writing technical documentation
Encode angle brackets when showing HTML snippets in documentation, so the source code is displayed instead of being rendered.

FAQ

What is HTML entity encoding?
It replaces special characters such as <, >, & and quotes with safe equivalents like <, > and &, so a browser displays them as text instead of parsing them as markup.
When do I need to encode HTML entities?
Always encode user-supplied content before inserting it into an HTML page, to prevent XSS. Special characters in email templates and XML documents need encoding too.
What if the decoded characters look wrong?
Check that the entities in the input are well-formed. This tool follows the standard HTML entity specification, so an unrecognized entity is likely private or non-standard.
Are Unicode character references supported?
Yes. It decodes both decimal and hexadecimal numeric character references, and can encode arbitrary Unicode characters.