HTML Entities

In HTML, some characters have special meanings.

For example, < and > are used to define tags so if you type them directly, the browser confuses them as HTML code.

To fix this, HTML provides a way to display such characters correctly called HTML Entities.

They start with & and end with ;

Example:

&lt;div&gt;Hello&lt;/div&gt;

This will display:

<div>Hello</div>

Why Use HTML Entities?

ReasonExplanation
Prevent ErrorsReserved characters (like < or >) won’t break your HTML code
Universal DisplayEnsure special symbols (€, ©, ₹) appear correctly across all browsers
AccessibilityHelps screen readers interpret content properly
ReadabilityKeeps HTML clean and structured
ProfessionalismUsed in clean, validated, W3C-compliant code

Basic HTML Entity Structure

Each HTML entity has three parts:

&entity_name;
OR
&#entity_number;

Example:

<p>2 &lt; 5 and 5 &gt; 2</p>

Commonly Used HTML Entities

CharacterEntity NameEntity NumberDescription
&&amp;&#38;Ampersand
<&lt;&#60;Less-than sign
>&gt;&#62;Greater-than sign
"&quot;&#34;Double quotation mark
'&apos;&#39;Single quotation mark
©&copy;&#169;Copyright symbol
®&reg;&#174;Registered trademark
&#8377;Indian Rupee symbol
&euro;&#8364;Euro symbol
&nbsp;&#160;Non-breaking space

Example of Displaying Reserved Symbols

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Learn HTML entities and how to display special characters like <, >, ©, and ₹ correctly.">
  <meta name="keywords" content="HTML entities, HTML special characters, less than greater than, HTML symbols, HTML encoding">
  <meta name="author" content="Dharmesh Kundariya">
  <title>HTML Entities Tutorial</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <header>
    <h1>HTML Entities Tutorial</h1>
    <p>Display reserved and special characters in HTML without breaking code.</p>
  </header>

  <main>
    <section>
      <h2>Reserved Characters Example</h2>
      <p>HTML code:</p>
      <pre><code>&lt;h2&gt;This is a heading&lt;/h2&gt;</code></pre>
      <p>Output:</p>
      <p><h2>This is a heading</h2></p>
    </section>

    <section>
      <h2>Special Symbols</h2>
      <p>&copy; 2025 WebTutorials | All Rights Reserved</p>
      <p>Price: &#8377; 999</p>
      <p>Trademark: &reg; WebTutorials Brand</p>
    </section>
  </main>

  <footer>
    <p>&copy; 2025 Dharmesh Kundariya. All rights reserved.</p>
  </footer>
</body>
</html>

Quick Reference Table

SymbolEntityDescription
©&copy;Copyright
&trade;Trademark
&rarr;Right arrow
&larr;Left arrow
&uarr;Up arrow
&darr;Down arrow
±&plusmn;Plus–minus sign
×&times;Multiplication sign
÷&divide;Division sign
°&deg;Degree symbol

HTML Entities are a must-know concept for every web developer. They make your pages error-free, accessible, and professional.

Whenever you need to display reserved characters, always use entities, it’s a small change that gives your site a big quality boost.

Leave a Comment