Character Entity Encoder.

HTML XML Entity Converter. Encode and decode HTML/XML character entities. Support for named (©), decimal (©), and hexadecimal (©) formats.

Character Entity Encoder

Encoding to HTML/XML Entities

Special characters will be converted to HTML/XML entities (e.g., < → &lt;)

Example Texts

Entity Types

Named Entities

Human-readable names for common characters

< > & " ©

Decimal Entities

Numeric code points in base 10

< > & " ©

Hexadecimal Entities

Numeric code points in base 16

< > & " ©

Common Entities

<&lt;
>&gt;
&&amp;
"&quot;
©&copy;
®&reg;
€&euro;
—&mdash;

Quick Tips

For HTML

Use named entities for better readability

For XML

Only < > & " ' are predefined

For JavaScript

Use "\u003C" or "\x3C" in strings

For Security

Always encode user input to prevent XSS

Use cases

Real-world uses.

XSS Prevention
Encode user input before displaying in HTML to prevent cross-site scripting attacks. Essential security practice for web applications.
HTML/XML Development
Safely include special characters in HTML/XML content. Display code examples, mathematical formulas, and special symbols correctly.
Data Storage
Store text with special characters safely in XML databases or HTML-based formats. Prevent parsing errors and data corruption.
Internationalization
Handle international characters in HTML. Ensure proper display of accented characters, symbols, and special punctuation.
Content Migration
Convert between entity-encoded and plain text when migrating content between systems or CMSs.
Email Security
Encode HTML email content to prevent email clients from executing malicious code. Protect recipients from attacks.
SEO & Metadata
Properly encode special characters in meta tags, titles, and descriptions for correct display in search results.
Documentation
Display code examples in documentation without breaking HTML. Show < > & characters in technical writing.

How it works

Four steps.

  1. 01

    Paste text or HTML/XML code that needs entity encoding or decoding.

  2. 02

    Choose mode (Encode/Decode) and entity type (Named, Decimal, or Hexadecimal).

  3. 03

    Configure encoding options: special chars, quotes, accents, or all non-ASCII.

  4. 04

    Copy the processed text or download it for use in your web project.

Features

Key Features of Character Entity Encoder.

Professional HTML/XML entity encoding and decoding.
  • Bidirectional Conversion

    Encode characters to entities or decode entities back to characters instantly.

  • 3 Entity Types

    Support for Named (&copy;), Decimal (&#169;), and Hexadecimal (&#xA9;) entities.

  • Real-Time Processing

    Instant encoding/decoding with live preview and conversion statistics.

  • XSS Prevention

    Encode user input to prevent XSS attacks and injection vulnerabilities.

  • Granular Control

    Choose exactly what to encode: special chars, quotes, accents, or all non-ASCII.

  • Batch Processing

    Process entire HTML/XML files at once with upload and download support.

  • International Support

    Handle accented characters, symbols, and special characters from any language.

  • Format Compatible

    Works with HTML, XML, XHTML, and any format that uses character entities.

FAQ

Questions.

Can't find an answer? Send us your question.

What are HTML character entities?

HTML character entities are special codes that represent characters in HTML/XML. For example, &lt; represents <, &copy; represents ©. They're used to display special characters that might otherwise be interpreted as code.

When should I encode characters?

Encode characters when: 1) Displaying user input in HTML to prevent XSS attacks, 2) Including special characters like & in HTML content, 3) Ensuring compatibility with older systems, 4) Storing text in XML/HTML format.

What's the difference between named, decimal, and hex entities?

Named entities use words (&copy;), decimal uses numbers (&#169;), and hexadecimal uses hex numbers (&#xA9;). Named entities are readable but limited. Decimal/hex can represent any Unicode character but are less readable.

Should I encode all special characters?

No! Only encode what's necessary. Always encode & in HTML content. Encode quotes in attribute values. Modern HTML5 supports most Unicode characters directly, so encoding everything is usually unnecessary.

Can this prevent XSS attacks?

Yes! Encoding user input is a key XSS prevention technique. Converting < to &lt; prevents browsers from interpreting malicious scripts. However, use this as part of a comprehensive security strategy, not the only defense.

Which entity type should I use?

Use named entities for common characters (better readability). Use decimal for uncommon characters (universal support). Use hexadecimal when working with Unicode code points (matches Unicode notation).

Does this work with emoji?

Yes! Emoji can be encoded to decimal or hexadecimal entities. For example, 😀 becomes &#128512; or &#x1F600;. However, modern browsers support emoji directly, so encoding is usually unnecessary.

Can I decode entities in JavaScript strings?

This tool decodes HTML/XML entities. For JavaScript escape sequences (\u003C), use a JavaScript-specific tool. HTML entities and JS escapes are different formats.

Is this safe for processing user input?

Yes! All processing happens in your browser. However, remember that encoding is just one step in security. Always validate and sanitize user input on the server side too.

Can I process large HTML files?

Yes! Upload HTML/XML files of any size. The tool processes everything instantly in your browser without sending data to servers.

Related tools

More Web Development tools.