Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
HTML Entity Encoder/Decoder

HTML Entity Encoder/Decoder

Convert special characters to HTML entities and decode entities back to text. Supports named, decimal, and hexadecimal formats.

What Are HTML Entities?

HTML entities are special codes used to represent characters that have special meaning in HTML or that cannot be easily typed on a keyboard. For example, the less-than sign (<) is written as &lt; in HTML to prevent the browser from interpreting it as a tag.

This tool helps you quickly convert between regular text and HTML entity codes. Whether you're a web developer inserting special characters into your markup, or you need to decode a string full of entity references, this encoder/decoder handles it instantly.

Supported Encoding Formats

Named Entities

Human-readable codes like &amp;, &copy;, &lt;

Decimal Numeric

Character codes in decimal like &#38;, &#169;

Hexadecimal Numeric

Character codes in hex like &#x26;, &#xA9;

How to Use

Encoding Text

1

Select Mode

Make sure Encode mode is selected (active by default)

2

Choose Format

Select your preferred format: Named, Decimal, or Hex

3

Input Text

Type or paste your text in the left panel

4

Get Results

The encoded result appears instantly in the right panel

5

Copy Output

Click the Copy button to copy the result to your clipboard

Decoding Entities

1

Switch Mode

Switch to Decode mode using the toggle button

2

Paste Entities

Paste your HTML entities in the left panel

3

View Results

The decoded text appears instantly in the right panel

Using the Reference Table

1

Open Reference

Click Entity Reference to expand the reference panel

2

Browse or Search

Browse categories or use the search bar to find specific entities

3

Copy Entity

Click any row to copy the entity name to your clipboard

Features

Three Encoding Formats

Encode your text using the format that best fits your needs. Named entities are the most readable (&amp;), while decimal (&#38;) and hex (&#x26;) codes cover every Unicode character.

  • Named entities for readability
  • Decimal for standard numeric codes
  • Hex for compact representation

Real-Time Conversion

Results update automatically as you type — no need to press a convert button. The conversion uses debouncing to stay responsive even with large texts.

  • Instant results as you type
  • Optimized for large texts
  • No manual conversion needed

Swap Function

Quickly reverse your conversion with the swap button. The output becomes the new input and the mode toggles automatically, making round-trip encoding and decoding effortless.

  • One-click input/output swap
  • Automatic mode switching
  • Seamless round-trip conversion

Entity Reference Table

Browse a comprehensive collection of HTML entities organized into six categories: Common, Symbols, Math, Arrows, Currency, and Greek. Use the search bar to find any entity by character, name, code, or description.

  • Six organized categories
  • Powerful search functionality
  • One-click copy to clipboard
Your Data Stays Private: All processing happens in your browser. Your text never leaves your device, and we don't collect or store any input data. No uploads, no tracking — complete privacy guaranteed.

Frequently Asked Questions

What is the difference between Named, Decimal, and Hex formats?

Named entities use human-readable codes like &copy; for ©. Decimal uses the character's Unicode number in base 10 (&#169;), and Hex uses base 16 (&#xA9;).

All three produce the same result in a browser, but named entities are easier to read while numeric formats support any Unicode character.

Named

Human-Readable

  • Easy to understand
  • Limited character set
  • Example: &copy;
Numeric

Universal Coverage

  • All Unicode characters
  • Decimal or Hex format
  • Example: &#169; or &#xA9;

Why should I encode HTML entities?

Encoding prevents browsers from misinterpreting characters as HTML markup. For example, a < character in your content could break your page layout if not encoded as &lt;.

Encoding also lets you display special characters that aren't available on standard keyboards.

Common mistake: Forgetting to encode special characters can lead to broken HTML structure, security vulnerabilities (XSS attacks), and display issues across different browsers.
  • Prevents HTML parsing errors
  • Displays special characters correctly
  • Improves security (prevents XSS)
  • Ensures cross-browser compatibility

Can I decode mixed entity types?

Yes. The decoder handles named, decimal, and hex entities all at once. For example:

Mixed Entity Example
&lt;p&gt;&#169; &amp; &#x2122;

This correctly decodes to: <p>© & ™

Pro tip: You can paste HTML code containing multiple entity formats, and the tool will decode all of them simultaneously without any configuration needed.

What happens to characters without a named entity?

When using Named format, characters that have no named entity (such as accented letters like ñ or ü) automatically fall back to decimal numeric encoding.

In Decimal or Hex mode, all non-ASCII and HTML-special characters are encoded numerically.

Character Named Entity Decimal Hex
© &copy; &#169; &#xA9;
ñ No named entity &#241; &#xF1;
ü No named entity &#252; &#xFC;

Is there a size limit?

There is no hard limit. The tool processes text entirely in your browser, so performance depends on your device. It handles typical code snippets and documents without any issues.

Small texts (< 10KB) Instant
Medium texts (10-100KB) Fast
Large texts (> 100KB) Device-dependent
Format:
Text
HTML Entities
Char Entity Decimal Hex Description
Switch between Encode and Decode modes using the toggle buttons
Choose encoding format: Named (&amp;), Decimal (&#38;), or Hex (&#x26;)
Use the Swap button to quickly reverse the conversion
Open the Entity Reference panel to browse and search common HTML entities
Click any row in the reference table to copy the entity to clipboard
All processing happens in your browser — no data is sent to any server
Want to learn more? Read documentation →
1/7
Comments 0
Leave a Comment

No comments yet. Be the first to comment!

Start typing to search...
Searching...
No results found
Try searching with different keywords