HTML Entity Encoder & Decoder

Encode text to HTML entities or decode entities back to characters. Supports named entities, decimal codes, hex codes, and Unicode symbols.
0 characters

Options

<div class="hello">Tom & Jerry © 2025</div>
0 entities converted

Common HTML Entities & Symbols

HTML Entity Reference Table

A scannable cheat sheet of common HTML entities and special characters, with the named, decimal, and hexadecimal code for each one alongside the character it renders. Core references like &, <, and > are server-rendered in the page, and you can filter the full list with the search box below.

Character Named Decimal Hex Description
& & & & Ampersand
< &lt; &#60; &#x3C; Less-than sign
> &gt; &#62; &#x3E; Greater-than sign
" &quot; &#34; &#x22; Double quotation mark
' &apos; &#39; &#x27; Apostrophe
[nbsp] &nbsp; &#160; &#xA0; Non-breaking space
¡ &iexcl; &#161; &#xA1; Inverted exclamation mark
¢ &cent; &#162; &#xA2; Cent sign
£ &pound; &#163; &#xA3; Pound sign
¤ &curren; &#164; &#xA4; Currency sign
¥ &yen; &#165; &#xA5; Yen sign
¦ &brvbar; &#166; &#xA6; Broken bar
§ &sect; &#167; &#xA7; Section sign
¨ &uml; &#168; &#xA8; Diaeresis
© &copy; &#169; &#xA9; Copyright sign
ª &ordf; &#170; &#xAA; Feminine ordinal indicator
« &laquo; &#171; &#xAB; Left angle quotation mark
¬ &not; &#172; &#xAC; Not sign
® &reg; &#174; &#xAE; Registered sign
¯ &macr; &#175; &#xAF; Macron
° &deg; &#176; &#xB0; Degree sign
± &plusmn; &#177; &#xB1; Plus-minus sign
² &sup2; &#178; &#xB2; Superscript two
³ &sup3; &#179; &#xB3; Superscript three
´ &acute; &#180; &#xB4; Acute accent
µ &micro; &#181; &#xB5; Micro sign
&para; &#182; &#xB6; Pilcrow sign
· &middot; &#183; &#xB7; Middle dot
¸ &cedil; &#184; &#xB8; Cedilla
¹ &sup1; &#185; &#xB9; Superscript one
º &ordm; &#186; &#xBA; Masculine ordinal indicator
» &raquo; &#187; &#xBB; Right angle quotation mark
¼ &frac14; &#188; &#xBC; Fraction one quarter
½ &frac12; &#189; &#xBD; Fraction one half
¾ &frac34; &#190; &#xBE; Fraction three quarters
¿ &iquest; &#191; &#xBF; Inverted question mark
× &times; &#215; &#xD7; Multiplication sign
÷ &divide; &#247; &#xF7; Division sign
&euro; &#8364; &#x20AC; Euro sign
&trade; &#8482; &#x2122; Trademark sign
&larr; &#8592; &#x2190; Left arrow
&uarr; &#8593; &#x2191; Up arrow
&rarr; &#8594; &#x2192; Right arrow
&darr; &#8595; &#x2193; Down arrow
&harr; &#8596; &#x2194; Left-right arrow
&forall; &#8704; &#x2200; For all
&part; &#8706; &#x2202; Partial differential
&exist; &#8707; &#x2203; There exists
&empty; &#8709; &#x2205; Empty set
&nabla; &#8711; &#x2207; Nabla
&isin; &#8712; &#x2208; Element of
&notin; &#8713; &#x2209; Not an element of
&prod; &#8719; &#x220F; Product sign
&sum; &#8721; &#x2211; Summation sign
&minus; &#8722; &#x2212; Minus sign
&radic; &#8730; &#x221A; Square root
&prop; &#8733; &#x221D; Proportional to
&infin; &#8734; &#x221E; Infinity
&and; &#8743; &#x2227; Logical and
&or; &#8744; &#x2228; Logical or
&cap; &#8745; &#x2229; Intersection
&cup; &#8746; &#x222A; Union
&int; &#8747; &#x222B; Integral
&asymp; &#8776; &#x2248; Approximately equal
&ne; &#8800; &#x2260; Not equal
&le; &#8804; &#x2264; Less than or equal
&ge; &#8805; &#x2265; Greater than or equal
&lArr; &#8656; &#x21D0; Double left arrow
&uArr; &#8657; &#x21D1; Double up arrow
&rArr; &#8658; &#x21D2; Double right arrow
&dArr; &#8659; &#x21D3; Double down arrow
&hArr; &#8660; &#x21D4; Double left-right arrow
&spades; &#9824; &#x2660; Spade suit
&clubs; &#9827; &#x2663; Club suit
&hearts; &#9829; &#x2665; Heart suit
&diams; &#9830; &#x2666; Diamond suit

What Are HTML Entities?

HTML entities are character references that let HTML display reserved characters and symbols safely. They begin with an ampersand and end with a semicolon. For example, the less-than sign is written as &lt;, and an ampersand is written as &amp;.

A few characters are reserved in HTML because the browser uses them to build the page. The angle brackets < and > open and close tags, the ampersand & begins every entity, and quotes wrap attribute values. To show those characters as plain text rather than have the browser act on them, you replace each one with its entity. Entities also give you a reliable way to write symbols and Unicode characters that are hard to type, such as &copy; for ©, &euro; for €, or a numeric reference like &#128512; for an emoji.

Every entity comes in up to three forms: a named reference such as &amp;, a decimal reference such as &#38;, and a hexadecimal reference such as &#x26;. All three render the same character; named entities are the easiest to read, while numeric entities work for any Unicode code point.

Use this page to encode HTML entities, decode HTML entities, see worked conversion examples, review common use cases, check the ampersand entity, or browse the HTML entity reference table.

Encode HTML Entities

HTML encoding converts characters such as &, <, >, quotes, and symbols into entity references. Encoding is useful when text needs to be shown inside markup without being interpreted as markup.

  • Named entities: readable values like &amp;, &copy;, and &hearts;
  • Decimal entities: numeric values like &#38; and &#169;
  • Hexadecimal entities: hex values like &#x26; and &#xA9;

Start with the HTML entity encoder above, then compare the output against the reference table.

Decode HTML Entities

HTML decoding converts entity references back into readable text. For example, &amp; decodes to &, &lt; decodes to <, and &#xA9; decodes to ©.

The decoder supports named HTML entities plus decimal and hexadecimal numeric references. This makes it useful for reviewing copied HTML snippets, CMS output, escaped JSON strings, and source text that contains encoded characters.

Decoding is also the fix for entities that show up as literal text on a page. If you see &amp;amp; or &lt; printed on screen instead of the character it represents, the text was usually encoded twice. Paste it into the decoder and run Decode once or twice to recover the original characters.

HTML Entity Examples

These before-and-after examples show how everyday text and symbols look once they are encoded as HTML entities. The left column is what you type; the right column is the encoded output you can paste safely into HTML.

Input (plain text) Encoded HTML entity output Why
Tom & Jerry Tom &amp; Jerry A literal ampersand must be encoded so it is not read as the start of an entity.
<div class="card"> &lt;div class=&quot;card&quot;&gt; Encoding <, >, and quotes lets you show HTML as text instead of rendering it.
5 > 3 && 2 < 4 5 &gt; 3 &amp;&amp; 2 &lt; 4 Math and logic snippets stay intact when the comparison and ampersand characters are encoded.
© 2025 — Acme™ &copy; 2025 &mdash; Acme&trade; Named entities make copyright, dash, and trademark symbols readable in source.
€49 & £39 &euro;49 &amp; &pound;39 Currency symbols can be written as named entities for maximum compatibility.
Café résumé Caf&#233; r&#233;sum&#233; Accented letters can be encoded as decimal references when you need pure ASCII output.
Rocket 🚀 Rocket &#128640; (hex &#x1F680;) Emoji and other Unicode characters encode as decimal or hexadecimal numeric entities.
{"name":"A & B"} {"name":"A &amp; B"} When a JSON string is rendered inside HTML, encoding the ampersand keeps it valid in both contexts.

Paste any of these into the encoder above to reproduce the output, then switch to Decode to convert the entities back to their original characters.

Common Use Cases

HTML entity encoding and decoding solves a handful of recurring, real-world problems. Here is when reach for this tool.

Display code in a blog post or docs

Showing an HTML snippet as text requires encoding <, >, and & so the browser prints the markup instead of running it.

Fix double-encoded entities

If a page shows &amp;amp; or visible &lt; tags, the text was encoded twice. Decode it here to recover clean characters.

Paste special characters into a CMS

Currency, accents, and symbols pasted from Word or a PDF often break. Encoding them to entities keeps them stable across editors and templates.

Escape user-generated content

Encoding reserved characters in user input is one layer of safe rendering, helping avoid broken layouts and unintended markup when content is shown back on a page.

Email & newsletter HTML

Email clients are strict about encoding. Converting symbols and non-ASCII characters to entities helps them render consistently across inboxes.

Encode emoji and Unicode

Emoji and other Unicode characters can be written as decimal (&#128512;) or hex (&#x1F600;) entities for environments that expect ASCII.

Ampersand HTML Entity: &amp;

The ampersand character starts every HTML entity, so a literal ampersand should be encoded as &amp; when it appears in text. The same character can also be written as decimal &#38; or hexadecimal &#x26;.

Common examples include brand names, query strings shown as text, and code examples: AT&amp;T displays as AT&T. See the first row of the entity table for the ampersand formats.

How to Use This Tool

  1. Paste or type text in the input area above
  2. Select Encode to convert characters to HTML entities, or Decode to convert entities back to characters
  3. Choose named, decimal, or hexadecimal entity output when encoding
  4. Click Convert and copy the result

Use the Encode Scope option to control how much is encoded: encode only the reserved special characters, every non-ASCII character, or every character. Everything runs in your browser, so you can safely paste private or sensitive text. When you are done, the entity reference table below lets you look up the named, decimal, and hex code for any common character.

Frequently Asked Questions

What are HTML entities?
HTML entities are character references used for reserved HTML characters such as <, >, &, quotation marks, and symbols that are not easy to type. They start with & and end with ;. For example, &lt; represents the less-than character.
What is the difference between named and numeric entities?
Named entities use readable names such as &amp; for &, while numeric entities use character codes such as &#38; or &#x26;. Named entities are easier to scan, and numeric entities work for any Unicode character.
Why do I need to encode HTML entities?
Encoding HTML entities helps safely render text in HTML when it is used with proper context-aware escaping. It also ensures special characters display correctly in browsers and avoids breaking your HTML markup when including user-generated content.
How do I use an HTML encoder decoder?
Paste text into the input area, select Encode or Decode, choose named, decimal, or hexadecimal output, and click Convert. The tool works in both directions so you can encode text to entities or decode entities back to readable characters.
Can I encode and decode HTML entities in both directions?
Yes. Switch between Encode and Decode modes, or use the Swap button to reverse your last conversion. You can HTML encode entities to any supported format and decode them back in the same workflow.
Does this tool send my data to a server?
No. All encoding and decoding happens entirely in your browser using JavaScript. No data is ever sent to our servers, making it completely safe for sensitive content.
What characters should I encode for HTML?
At minimum, encode the reserved characters & (&amp;), < (&lt;), > (&gt;), double quotes (&quot;), and apostrophes (&#39; or &apos;). For strict text output, encode non-ASCII characters too.
Can I decode numeric HTML entities?
Yes. This tool decodes named entities such as &amp; and numeric entities in decimal (&#38;) or hexadecimal (&#x26;) format back to their original characters.
What is the difference between HTML encoding and URL encoding?
HTML encoding converts characters to HTML entities for safe display in web pages. URL encoding (percent-encoding) converts characters to %XX format for safe use in URLs. They serve different purposes and use different formats.