< and > are HTML entities and stand for less than(<) and greater than(>) respectively. HTML entities are reserved characters that are used to represent some special characters within HTML. In this blog, we will learn HTML entities in detail.
Table of Contents:
Practical Example of < and >
Let’s learn the concept of < and > with the help of an example:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Math Symbols</title>
</head>
<body>
<p>5 > 3 (5 is greater than 3)</p>
<p>10 ≤ 20 (10 is less than or equal to 20)</p>
<p>Summation symbol: ∑</p>
</body>
</html>
Output:
5 > 3 (5 is greater than 3)
10 ≤ 20 (10 is less than or equal to 20)
Summation symbol: ∑
What are the entities in HTML?
HTML entities are reserved characters that are used to represent some special English characters like: (<, >, <=, >=, &, etc.). HTML entities start with an ampersand (&) followed by some characters or numbers and end with a semicolon(;). HTML entities are the codes that are interpreted by HTML language.
HTML entities are represented by both numbers and characters.
- And For characters, we have to just write the characters eg: >
- For numbers, we have to use #. eg: ©
Example:
- <
- >
-
- ©
- © etc.
List of some other HTML entities
Here are some of the most used HTML entities by developers while building any application:
HTML entity | Meaning | Symbol |
< | less than | < |
> | greater than | > |
& | Ampersand | & |
" | double quotation mark | “ ” |
' | apostrophe | ‘ ’ |
≥ | greater than equal | ≥ |
≤ | less than equal | ≤ |
© | Copyright Symbol | © |
| Non-breaking space | whitespace |
€ | Euro | € |
π | Pi | π |
∃ | Exist | ∃ |
Become Web Development pro!
Join our Web -Dev Course today!
Example: Special Characters
Let’s use some special characters in our HTML documents:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Special Characters</title>
</head>
<body>
<p>Copyright © 2025 YourCompany</p>
<p>Trademark ™ YourBrand</p>
<p>Currency: € 100, £ 50, ¥ 1000</p>
</body>
</html>
Output:
Copyright © 2025 YourCompany
Trademark ™ YourBrand
Currency: € 100, £ 50, ¥ 1000
Conclusion
HTML entities are used to represent some special characters in our Document with the help of some codes, which are further interpreted by HTML language. With the help of HTML entities, special characters like <, >, and & can be displayed correctly on web pages.
So far in this article, we have learned HTML entities, a list of different HTML entities with their meaning and symbols. If you want to learn more about HTML, you may refer to our HTML course.
FAQs
1. How do you display less-than (<) and greater-than (>) signs?
We can use HTML entities: < for displaying less than(<) and > for greater than(>).
2. What are numeric HTML entities?
Numeric entities use numbers to represent characters, like < for < and > for >.
3. What does <!– –> mean in HTML?
This command is used to add comments in HTML.
4. Can I use < and > directly in HTML?
No, we should not use < and > directly unless they are part of an HTML tag.
5. Why do we use HTML?
HTML is used to structure and organize content on the web, defining elements like text, images, and links.
1. How do you display less-than (<) and greater-than (>) signs?
We can use HTML entities: < for displaying less than(<) and > for greater than(>).
2. What are numeric HTML entities?
Numeric entities use numbers to represent characters, like < for < and > for >.