0 chars
    Stats:Input: 0 charsOutput: 0 charsEntities converted: 0

    Common HTML Entities

    CharacterEntity
    &&
    <&lt;
    >&gt;
    "&quot;
    '&#039;
    ย &nbsp;
    ยฉ&copy;
    ยฎ&reg;
    โ„ข&trade;
    โ‚ฌ&euro;
    ยฃ&pound;
    ยฅ&yen;
    ยข&cent;
    ยง&sect;
    ยฑ&plusmn;
    ร—&times;
    รท&divide;
    ยฐ&deg;
    โ†&larr;
    โ†’&rarr;

    100% Private โ€” Your Data Never Leaves Your Browser

    All HTML entity encoding and decoding is performed entirely in your browser using client-side JavaScript. No data is sent to any server, stored, or tracked.

    How to Use the HTML Entity Encoder/Decoder

    1. Choose your mode โ€” Select Encode to convert special characters to HTML entities, or Decode to convert HTML entities back to readable characters. Click the mode buttons in the toolbar or use the dedicated Encode/Decode action buttons.
    2. Enter your input โ€” Type or paste your text into the input textarea. For encoding, enter text that contains special characters like angle brackets, ampersands, quotes, or other symbols. For decoding, paste a string containing HTML entities like &amp;, &lt;, or &#039;.
    3. Encode or Decode โ€” Click the Encode or Decode button to process your input. Alternatively, enable the auto-encode toggle for real-time processing as you type. The result appears instantly in the output panel on the right.
    4. Review the stats โ€” The stats bar shows input length, output length, and the number of entities converted or decoded. Use this to verify that all expected characters were properly processed.
    5. Copy or Swap โ€” Click Copy Output to copy the result to your clipboard. Use the Swap button to move the output back to input and flip between encode/decode modes, useful for round-trip verification.

    Features

    Understanding HTML Entities

    What Are HTML Entities?

    HTML entities are a way to represent characters that have special meaning in HTML or that cannot be easily typed on a keyboard. They begin with an ampersand (&) and end with a semicolon (;). There are three types: named entities like &amp; and &lt; which use descriptive names, decimal numeric entities like &#60; which use the Unicode code point in decimal, and hexadecimal numeric entities like &#x3C; which use the code point in hex. The HTML5 specification defines around 250 named entities covering common symbols, accented characters, and mathematical operators.

    XSS Prevention with Entity Encoding

    Cross-Site Scripting (XSS) is one of the most common web security vulnerabilities. It occurs when untrusted user input is rendered as HTML without proper escaping. By encoding the five critical characters โ€” &amp; &lt; &gt; " ' โ€” you ensure that the browser treats the content as plain text rather than executable markup. This prevents attackers from injecting script tags, event handlers like onclick, or other malicious HTML. While modern frameworks handle this automatically, manual entity encoding is essential for raw HTML contexts, email templates, and server-rendered pages.

    Named vs Numeric Entities

    Named entities (like &amp;, &lt;, &copy;) are human-readable and preferred for common characters because they make HTML source code easier to understand. Numeric entities come in two forms: decimal (&#38; for &) and hexadecimal (&#x26; for &). While named entities only exist for about 250 characters, numeric entities can represent any of the 149,000+ characters in the Unicode standard, including emojis (&#128522; for ๐Ÿ˜Š), rare symbols, and characters from any world language. For the five essential HTML-unsafe characters, named entities are universally supported and preferred.

    Encoding Order Matters

    When encoding text to HTML entities, the ampersand (&amp;) must always be processed first. This is because every entity reference starts with &amp; โ€” so if you encode &lt; to &amp;lt; first, then encode &amp;, the &amp; in &amp;lt; would itself become &amp;amp;lt;, which is incorrect. The correct sequence is: encode all &amp; to &amp;amp; first, then encode &lt;, &gt;, &quot;, and '. Our tool follows this order automatically. During decoding, no special ordering is needed because the browser's HTML parser handles all entity types simultaneously and correctly.

    Common Use Cases

    Preventing XSS in User Content

    Encode user-generated comments, forum posts, and profile information before rendering in HTML to prevent malicious script injection and protect your users from cross-site scripting attacks.

    Displaying Code Snippets

    When showing HTML, CSS, or JavaScript code examples on a web page, entity-encode the angle brackets and other special characters so the browser displays the code as text rather than interpreting it as markup.

    Email Template Development

    Encode special characters in HTML email templates where template engines may not provide automatic escaping, ensuring content renders correctly across different email clients.

    RSS and XML Feed Generation

    XML parsers are strict about special characters โ€” encode &, <, and > in RSS feed content, titles, and descriptions to produce valid XML that passes feed validator checks.

    Debugging Encoded Content

    Decode HTML entities found in API responses, scraped web content, or database fields to understand the actual text content being stored or transmitted.

    Server-Side HTML Construction

    When building HTML strings on the server without a templating engine, encode all dynamic values before concatenation to prevent injection vulnerabilities in server-rendered pages.

    Data Migration and Cleanup

    Decode or re-encode HTML entities when migrating content between CMS platforms that use different encoding conventions or storage formats.

    Security Auditing

    Verify that security-sensitive output has been properly encoded by decoding it and checking for unexpected raw HTML tags or script content that should have been escaped.

    HTML Entity Encoder/Decoder Tips

    Frequently Asked Questions

    Related Tools

    Faisal Hossain โ€” Founder & Developer of FreeKit

    Faisal Hossain

    Founder & Developer of FreeKit

    I personally designed and built every tool on this website โ€” including the one you just used. If these tools have been helpful, I can build custom tools, automation workflows, websites, and SEO solutions tailored to your business.

    Services

    • SEO Audit, Technical SEO & On-Page SEO
    • WordPress & Shopify Development
    • WooCommerce & E-commerce Management
    • n8n & AI Workflow Automation
    • Python Automation & Web Scraping
    • VPS, Linux & Self-Hosted Infrastructure
    • AI Vibe Coding Expert โ€” APPS, WEB, SAAS

    Availability

    Remote: Available Now

    United States & European company

    USD $25/hour or USD $1,500/month

    On-site: Open to Relocation

    With work visa & travel support