ToolHub
Open Tool

HTML Entities Encoder

Encode text to named, decimal, or hexadecimal HTML entities and decode entities back to text

Developer Tools

About This Tool

The HTML Entities Encoder is a bidirectional tool that encodes text into HTML entities and decodes HTML entities back to text. It supports three entity types β€” named entities like <, decimal numeric entities like <, and hexadecimal numeric entities like < β€” with a side-by-side editor and one-click copy.

Key Features

Quick Preview

Use Cases

htmlentitiesencoding

Frequently Asked Questions

What is the HTML Entities Encoder?

The HTML Entities Encoder is a bidirectional tool that encodes text into HTML entities and decodes HTML entities back to text. It supports three entity types: named, decimal numeric, and hexadecimal numeric.

What are the three entity types?

Named entities use readable names like &lt; for <. Decimal numeric entities use character codes like &#60;. Hexadecimal numeric entities use hex codes like &#x3C;. All three produce the same result when rendered.

Does it handle Unicode characters?

Yes. For named entity mode, characters without a named entity are encoded as decimal numeric entities. For decimal and hexadecimal modes, all characters above ASCII 127 plus the five reserved HTML characters are encoded.

Can I decode HTML entities?

Yes. Switch to Decode mode and paste any HTML entities. The tool will convert them back to their original characters, handling named, decimal, and hexadecimal entities automatically.

Is this tool useful for XSS prevention?

Encoding special characters like <, >, and & into HTML entities is a key defense against XSS attacks. This tool helps you encode user input to prevent browsers from interpreting it as HTML markup.