Real-time PreviewNamed & Numeric EntitiesXSS Prevention

How It Works

1

Enter Your Text

Type or paste text with special characters, or paste HTML entities to decode.

2

Choose Direction

Toggle between Encode and Decode to convert in either direction.

3

Preview & Copy

See the HTML preview in real-time and copy the result with one click.

Frequently Asked Questions

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. They start with an ampersand (&) and end with a semicolon (;). For example, &lt; represents the less-than sign (<) and &amp; represents the ampersand (&).
What are the most common HTML entities?
The most commonly used HTML entities are &amp; (ampersand), &lt; (less than), &gt; (greater than), &quot; (double quote), &#39; (single quote/apostrophe), and &nbsp; (non-breaking space). These are essential for displaying special characters safely in HTML.
Why do I need to encode HTML?
HTML encoding is necessary to display special characters correctly in web pages. Without encoding, characters like <, >, and & would be interpreted as HTML markup instead of being displayed as text. Encoding also prevents cross-site scripting (XSS) attacks by neutralizing potentially malicious code.
What is the difference between named and numeric entities?
Named entities use a descriptive name (like &amp; for ampersand), while numeric entities use the character's Unicode code point in decimal (&#38;) or hexadecimal (&#x26;) format. Named entities are more readable, but numeric entities can represent any Unicode character.
How does HTML encoding prevent XSS attacks?
HTML encoding prevents XSS (Cross-Site Scripting) attacks by converting characters like < and > into their entity equivalents (&lt; and &gt;). This ensures that any user-supplied content is displayed as text rather than being interpreted as executable HTML or JavaScript code.
Share:

About HTML Entities

What this tool does

Encoder and decoder tools convert data between Base64, URL-encoded, HTML entities, ROT13, Morse code, binary, hex, and JWT formats. They handle both encoding (plain to encoded) and decoding (encoded back to plain).

Why use this tool

Web developers constantly encounter encoded data in APIs, URLs, tokens, and configuration files. Being able to decode a JWT payload or Base64 string instantly saves round-trips to the terminal or Stack Overflow.

How it works

Each tool applies a specific encoding algorithm to your input bytes. Base64 maps every 3 bytes to 4 ASCII characters. URL encoding escapes special characters with percent-hex pairs. JWT decoding splits the token at dots and Base64-decodes each segment.

Pro tip

When debugging JWTs, always check the "exp" (expiration) claim first. Most authentication bugs come from expired tokens, and the decoded timestamp is easy to overlook.

Love this tool? Explore 12467+ more

Free online tools for images, PDFs, text, code, and more. All running in your browser.

Explore All Tools