Encode special characters to HTML entities or decode HTML entities back to characters. Supports 200+ named entities, numeric decimal and hexadecimal entities, with multiple encoding modes. All processing happens client-side -- your data never leaves your browser.
Paste any text and instantly convert special characters to their HTML entity equivalents. Choose between minimal, full, or numeric-only encoding modes depending on your needs.
Decode HTML entities back to readable characters. Supports all 200+ named entities like © and —, decimal numeric entities (©), and hexadecimal entities (©).
See exactly how your encoded output would render in a browser. The live preview panel shows the visual result in real time so you can verify correctness before using the output.
Browse and search a comprehensive table of 200+ HTML character entities. Find the named, decimal, and hex codes for any character with instant search and filtering.
HTML entities are special sequences of characters used to represent symbols that have reserved meaning in HTML or that cannot be easily typed on a standard keyboard. Every HTML entity starts with an ampersand (&) and ends with a semicolon (;). They are essential for writing correct, secure, and cross-browser-compatible HTML documents.
There are three ways to represent a character as an HTML entity:
& for &, © for the copyright symbol, — for an em dash. There are about 250 named entities defined in the HTML specification.© for the copyright symbol, < for the less-than sign. Can represent any Unicode character.© for the copyright symbol, < for the less-than sign.There are two critical reasons to encode HTML entities:
<, >, and & have special meaning in HTML. If you want to display a literal < on a web page, you must encode it as <, otherwise the browser will interpret it as the start of an HTML tag.<script> tags or event handlers into your page through form inputs, comments, or URL parameters.&, <, >, ", and '. Best for most use cases where you want clean, readable output.&#NNN;). Useful when you need consistent, unambiguous encoding that does not depend on named entity support.< represents the less-than sign (<), & represents the ampersand (&), and © represents the copyright symbol. HTML entities ensure that browsers render characters correctly instead of interpreting them as HTML markup. Without entities, characters like < and > would be treated as tag delimiters, breaking your page layout or creating security vulnerabilities.
&, less-than (<) as <, greater-than (>) as >, double quote (") as " (required inside attribute values), and single quote/apostrophe (') as ' or ' (required inside single-quoted attributes). Beyond these five, encoding non-ASCII characters (accented letters, symbols, emoji) is recommended for maximum compatibility, especially if your document encoding is uncertain or you are working with systems that only support ASCII.
& and ;, such as & (ampersand), © (copyright), or — (em dash). They are easier to read and remember but only about 250 characters have named entities. Numeric entities use the Unicode code point in decimal (©) or hexadecimal (©) format and can represent any of the 140,000+ Unicode characters. Both forms are valid HTML and render identically in browsers. Use named entities for readability in hand-written HTML, and numeric entities when you need to represent characters that do not have a named equivalent.
<script>alert('hack')</script> as their "name." Without encoding, the browser would execute this as a real script. By encoding the input, the < becomes < and the > becomes >, so the browser displays the text literally instead of executing it as code. This is why output encoding (also called output escaping) is one of the primary defenses against XSS recommended by OWASP. Always encode user-supplied data before inserting it into HTML contexts.
©, —) when writing HTML by hand, as they are more readable and self-documenting. Use numeric entities (©, —) when you need to represent characters that do not have a named entity, when working with systems that may not recognize all named entities, or when you want a consistent encoding format for programmatic processing. Some older email clients and XML parsers only recognize the five basic named entities (&, <, >, ", ') and require numeric entities for everything else. In XML, only those five named entities are predefined -- all others must be numeric.
Check out our other free developer tools. Format JSON, decode JWTs, parse AWS ARNs, and more -- all from your browser with no sign-up required.
JSON Formatter →