Tool workspace

HTML Encoder / Decoder

Input

Convert special characters into HTML entities or decode HTML entities back into readable text. Encode or decode manually or as you type, preserve existing entities, convert non-ASCII characters, and process nested entities with up to five decoding passes.

Input

Output

Loading tool

Loading tool

Developer Tools

HTML Encoder / Decoder

Convert special characters into HTML entities or decode HTML entities back into readable text. Encode or decode manually or as you type, preserve existing entities, convert non-ASCII characters, and process nested entities with up to five decoding passes.

Quick guide

How to use

Encode text into HTML entities

Enter or paste your text into the input field.

Select the encoding options you need.

Choose Encode to convert special characters into HTML entities, or enable live conversion if you want the result to update as you type.

Copy the output or download it as a text file.

The encoder escapes ampersands, angle brackets, quotation marks, and apostrophes.

Example

Input:

<p>Tom & Jerry</p>

Encoded output:

&lt;p&gt;Tom &amp; Jerry&lt;/p&gt;

Decode HTML entities into readable text

Paste text containing HTML entities into the input field.

Choose Decode, or use live conversion.

Review the decoded text.

Copy or download the result.

Example

Input:

&lt;p&gt;Tom &amp; Jerry&lt;/p&gt;

Decoded output:

<p>Tom & Jerry</p>

The decoded result is displayed as text. It is not rendered or executed as HTML.

Details

About this tool

Convert special characters into HTML entities or decode HTML entities back into readable text. Encode or decode manually or as you type, preserve existing entities, convert non-ASCII characters, and process nested entities with up to five decoding passes.

What Are HTML Entities?

HTML entities are special codes used to represent characters in HTML. They are particularly useful when you need to display characters that HTML normally interprets as part of its markup.

For example, the less-than sign (<) and greater-than sign (>) are used to define HTML tags. The ampersand (&) introduces character references. If you want to display these characters as ordinary text, they may need to be escaped.

Some common HTML entities include:

Encoding and Decoding Options

Preserve existing HTML entities

Enable this option when your input already contains HTML entities that you do not want to encode again. This helps avoid changing existing entity references during encoding.

Convert non-ASCII characters to numeric entities

Use this option to represent non-ASCII characters as numeric HTML entities. For example, the character é can be represented as &#233;. This can be useful when preparing text for systems that expect numeric character references.

Decode nested HTML entities

Some text contains entities that have been encoded more than once. For example:

&amp;lt;

One decoding pass produces:

&lt;

A second pass produces:

<

You can decode nested entities using up to five passes. Use additional passes only when the input actually contains multiple layers of encoding.

Common Uses for an HTML Encoder / Decoder

Displaying code examples: Escape angle brackets and ampersands so HTML-like code appears as text instead of being interpreted as markup.

Preparing text for HTML content: Convert special characters into their corresponding HTML entities when needed.

Reading encoded text: Decode entity references copied from HTML documents, source code, or other text.

Checking entity encoding: Compare original text with its encoded or decoded version to understand how special characters are represented.

Additional Tool Features

Live or manual conversion: Choose automatic updates while typing or convert text when you are ready.

Example input: Load sample text to see how encoding and decoding work.

File upload: Select a text file or drag and drop it into the tool.

Copy and download: Copy the converted result or download it as a file.

Character and byte counts: Check the size of your input and output in characters and bytes.

Clear error messages: Identify invalid or unsupported input without guessing what went wrong.

Help

Frequently asked questions

What does an HTML encoder do?

An HTML encoder replaces selected special characters with HTML entities. For example, it converts &lt; into &amp;lt; and &amp; into &amp;amp;, helping browsers display those characters as text rather than interpreting them as markup.

What does an HTML decoder do?

An HTML decoder converts HTML entities back into their corresponding characters. For example, &amp;amp; becomes &amp;, and &amp;lt; becomes &lt;.

Is HTML encoding the same as encryption?

No. HTML encoding changes how characters are represented. It does not encrypt or protect information, and it should not be treated as a security mechanism on its own.

Why should I encode angle brackets?

The characters &lt; and &gt; are used to mark HTML tags. Encoding them as &amp;lt; and &amp;gt; helps display HTML-like text, such as code examples, without interpreting it as markup.

What is nested HTML entity decoding?

Nested entity decoding means decoding text that has been encoded more than once. For example, &amp;amp;lt; becomes &amp;lt; after one pass and &lt; after a second pass.

Does this tool execute decoded HTML?

No. The converted output is displayed as text and is not rendered or executed as HTML.

Does HTML encoding make text safe for every website?

No. The correct output encoding depends on where the data will be used, such as HTML text, an attribute, JavaScript, or a URL. This tool performs HTML entity conversion, but it does not replace context-specific output encoding, input validation, or other application security measures.