UtilopiaUtilopia

Command Palette

Search for a command to run...

HTML Entity Encode / Decode

Encode special characters to HTML entities or decode them back. Prevent XSS and display issues.

Loading tool...

What is HTML Entity Encode / Decode?

HTML entity encoding is the process of converting special characters into their corresponding HTML entity references so they can be safely displayed in web pages without being interpreted as HTML markup. Characters like <, >, &, ", and ' have special meaning in HTML and must be encoded to be displayed as literal text.

Our free online HTML entity encoder and decoder lets you quickly convert between plain HTML and entity-encoded text. This is essential for web developers who need to display code snippets in web pages, prevent XSS (Cross-Site Scripting) attacks by sanitizing user input, or work with HTML content that needs to be embedded within attributes or other markup contexts.

The encoder converts the five critical HTML characters: ampersand (&amp;), less-than (&lt;), greater-than (&gt;), double quote (&quot;), and single quote (&#39;). The decoder reverses the process, converting all HTML entities back to their original characters using the browser's built-in HTML parser. All processing happens entirely in your browser with no server communication.

How to Use This Tool

  1. Select the mode — Choose "Encode" to convert special characters to HTML entities, or "Decode" to convert HTML entities back to characters.
  2. Enter your input — Type or paste your HTML (for encoding) or entity-encoded text (for decoding) in the input area.
  3. Click Convert — Press the Encode or Decode button to perform the conversion.
  4. Copy the result — Click the Copy Output button to copy the result to your clipboard.
  5. Use Swap — Click the Swap button to quickly reverse the operation, using the output as the new input.

Frequently Asked Questions

Related Tools