Encode special characters to HTML entities or decode entities back to readable text.
Last updated: February 23, 2026
0 characters
| Character | Entity | Description |
|---|---|---|
| & | & | Ampersand |
| < | < | Less than |
| > | > | Greater than |
| " | " | Double quote |
| ' | ' | Apostrophe |
| (space) | | Non-breaking space |
| ยฉ | © | Copyright |
| ยฎ | ® | Registered |
| โข | ™ | Trademark |
| โ | — | Em dash |
| โ | – | En dash |
| โฆ | … | Ellipsis |
| ยซ | « | Left guillemet |
| ยป | » | Right guillemet |
| โข | • | Bullet |
| ยฐ | ° | Degree |
| ยฑ | ± | Plus-minus |
| ร | × | Multiplication |
| รท | ÷ | Division |
| โฌ | € | Euro |
| ยฃ | £ | Pound |
| ยฅ | ¥ | Yen |
| ยข | ¢ | Cent |
| ยง | § | Section |
| ยถ | ¶ | Paragraph |
| ยต | µ | Micro |
| ยฝ | ½ | One half |
| ยผ | ¼ | One quarter |
| ยพ | ¾ | Three quarters |
| โฅ | ♥ | Heart |
HTML entity encoding is the process of replacing characters that have special meaning in HTML with their corresponding entity references. This is essential for two primary reasons: preventing browsers from misinterpreting characters as HTML markup, and protecting web applications from cross-site scripting (XSS) attacks. Any time user-supplied content is rendered on a web page, it must be properly encoded to ensure that characters like <, >, &, and " are displayed as literal text rather than interpreted as HTML tags or attributes.
Cross-site scripting (XSS) is one of the most common web vulnerabilities. It occurs when an attacker injects malicious scripts into content that other users view. For example, if a user submits a comment containing <script>alert('hacked')</script> and the application renders it without encoding, the browser will execute the script. Proper HTML encoding converts the angle brackets to < and >, causing the browser to display the text literally rather than executing it as code. Modern web frameworks like React, Angular, and Vue automatically encode output by default, but developers must remain vigilant when using mechanisms that bypass this protection, such as React's dangerouslySetInnerHTML or Angular's [innerHTML] binding.
HTML entities come in two forms: named entities and numeric entities. Named entities use a memorable keyword, such as & for the ampersand or © for the copyright symbol. Numeric entities use the character's Unicode code point in either decimal (©) or hexadecimal (©) format. Named entities are easier to read and write, but not every Unicode character has a named entity. Numeric entities can represent any Unicode character, making them more versatile. The HTML5 specification defines over 2,000 named character references, covering a wide range of symbols, mathematical operators, Greek letters, and technical characters.
You should encode HTML entities whenever displaying user-generated content, rendering data from external APIs, or including special characters in HTML attributes. The five characters that must always be encoded in HTML content are: ampersand (&), less-than (<), greater-than (>), double quote ("), and single quote ('). Within attribute values enclosed in double quotes, at minimum the ampersand and double quote must be encoded. For content within <script> or <style> tags, different encoding rules apply and HTML encoding alone is not sufficient.
Character encoding determines how characters are stored as bytes. UTF-8 is the dominant encoding on the web, used by over 98% of websites. When your HTML document declares <meta charset="UTF-8">, the browser knows how to interpret the byte sequences in your document. With UTF-8, you can include most characters directly in your HTML source without using entities. However, the five special HTML characters (&, <, >, ", ') must still be encoded regardless of character encoding. Using HTML entities for non-ASCII characters is still recommended in some contexts, such as email HTML templates, where character encoding support may vary across email clients.
HTML5 significantly expanded the list of supported named entities compared to earlier HTML versions. The specification includes entities for mathematical symbols (∑, ∏, ∫), arrows (←, →), Greek letters (α, β, γ), and many more. These named entities improve readability of HTML source code compared to numeric references. However, for maximum compatibility, especially in XML-based formats like XHTML or SVG, using numeric entities is safer since XML processors only recognize a handful of named entities by default.
Encode special characters to HTML entities or decode entities back to readable text. This tool runs in-browser for fast results without account setup.
Yes. HTML Entity Encoder/Decoder is free to use on ConvertCrunch.
Results depend on the inputs and assumptions you provide. Always validate final numbers or outputs against your official workflow before publishing or filing.
ConvertCrunch tools are built for immediate use with no signup required.
This tool is part of larger workflows. Open a hub to continue with the next relevant tools.
Continue your workflow with these tools from the same playbook.
PDF Merger
Merge multiple PDFs into a single document.. Free online, browser-based tool with instant results and no signup.
PDF to Word Converter
Convert PDF documents to editable Word format.. Free online, browser-based tool with instant results and no signup.
JSON to CSV / CSV to JSON Converter
Convert between JSON and CSV formats instantly. Supports custom delimiters, nested objects, and file upload.
ZIP Compressor
Compress files into ZIP archives.. Free online, browser-based tool with instant results and no signup.
URL Encoder/Decoder
Encode and decode URL strings for safe query parameters, path segments, and web debugging.
AI Output Evaluator
Score model responses for relevance, structure quality, and risk signals to quickly diagnose weak output patterns.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings instantly. Supports UTF-8 and file encoding.
Chmod Calculator
Calculate Unix file permissions with an interactive checkbox matrix. Convert between octal and symbolic notation.
Color Converter
Convert colors between HEX, RGB, HSL, and CMYK formats. Includes a color picker and palette generator.
Cron Expression Parser
Validate cron syntax and preview upcoming run times in UTC to debug schedules before deployment.
CSS Flexbox Generator
Build flexbox layouts visually with a live preview. Adjust direction, wrapping, alignment, and gap, then copy the CSS.
CSS Gradient Generator
Generate linear gradient CSS with angle and multi-color stops, including live preview and copy-ready code output.
Next Step
Continue with PDF Merger