HTML emojis are graphical representations of emotions, objects, symbols, etc., displayed using Unicode characters or emoji entities within HTML documents. They enrich communication, adding visual context to web pages, emails, and messaging platforms.
The <meta charset=”UTF-8″> element defines the character set. Unreachable UTF-8 characters displayed with entity numbers starting with &# and ending with ; .
Syntax:
<!DOCTYPE html>
<html lang="en">
<head>
<title>UTF-8 Character Example</title>
</head>
<body>
<p>&#number;</p>
<!-- Replace 'number' with the corresponding UTF-8 character code -->
<p>☃</p>
<!-- Example: Unicode for a snowflake symbol -->
</body>
</html>
Emojis are also characters from the UTF-8 alphabet and can be used in HTML by mentioning the corresponding emoji, decimal (dec) or hexadecimal (hex) reference in the above syntax.
HTML Emojis Examples
1. HTML Emojis using Unicode Decimal reference
HTML Emojis are represented using Unicode decimal references like 😄 to display emojis, enabling the rendering of various symbols and icons in web content.
Example 1: Represent the following emoji in a webpage.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Emojis Example</title>
</head>
<body>
<h1>HTML Emojis Example</h1>
<p>
😄 This is a smiling face with open mouth
and smiling eyes emoji
</p>
<p>✌ This is a victory hand emoji</p>
<p>⌚ This is a watch emoji</p>
</body>
</html>
Output:

HTML Emoji
Explanation:
- In the above example we define the document type with <!DOCTYPE html>. Set charset with <meta charset=”UTF-8″>.
- Ensure proper display across devices with <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>.
- ?: Smiling face with open mouth and smiling eyes.
- âïļ: Victory hand emoji.
- â: Watch emoji.
- Emojis represented using Unicode values in HTML.
| Char | Decimal reference | Hexadecimal reference |
|---|
| ? | 128516 | 1F604 |
| â | 9996 | 270C |
| ? | 128350 | 1F55E |
2. HTML Emojis using Unicode hexadecimal reference
HTML Emojis are displayed using Unicode hexadecimal references like 😄, allowing the inclusion of diverse symbols and icons in web content.
Syntax:
<p>&#xhexaDecimal;</p>
Example 2: In this example, we will represent 😄, ✌and 🕞 emoji in a webpage with hexadecimal(hex) reference.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Emojis Example</title>
</head>
<body>
<h1>HTML Emojis Example using Unicode hexadecimal </h1>
<p>
😄 This is a smiling face with open mouth
and smiling eyes emoji
</p>
<p>✌ This is a victory hand emoji</p>
<p>⌚ This is a watch emoji</p>
</body>
</html>
Output:

HTML Emojis using Unicode hexadecimal
Explanation:
- In the above example we defined with <!DOCTYPE html> and <html lang=”en”>.
- Unicode hexadecimal references used for emojis, like 😄, ✌, and ⌚.
- Emojis represented by Unicode code points, enclosed in &#x and ;.
- Each emoji has a unique hexadecimal Unicode value.
- Emojis render according to their Unicode representations in modern web browsers.
Note: Since Emojis are characters, they can be copied, displayed and sized just like any other character in HTML.Â
Example 3: In this example, we will change the font size of the following emojis.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Emojis Example</title>
<style>
.large {
font-size: 2em;
/* Increase font size */
}
</style>
</head>
<body>
<h1>HTML Emojis Example</h1>
<h3>Transport symbols</h3>
<p>
🚂 Train
<span class="large">🛥</span> Tram
</p>
<h3>Office emojis</h3>
<p>
🏢 Office Building
<span class="large">💼</span> Laptop
</p>
<h3>People emojis</h3>
<p>
👨 Man
<span class="large">👩</span> Woman
</p>
<h3>People emojis</h3>
<p>
🐶 Dog
<span class="large">🦁</span> Lion
</p>
</body>
</html>
Output: The output contains the different sizes of emojis.

Html Emoji Example
Explanation:
- In the above example we defines various emojis using Unicode hexadecimal references.
- Emojis are categorised into transport symbols, office emojis, people emojis, and animal emojis.
- Each category includes two emojis, with every second emoji being larger in size.
- CSS is used to increase the font size of the larger emojis.
- The emojis are displayed alongside descriptive text to indicate their meaning or representation.
HTML Emojis – FAQs
How do you include emojis in HTML?
Simply use the emoji character directly in your HTML code, e.g., use Unicode code points, e.g., 😊.
Can I use emojis in HTML attribute values?
Yes, emojis can be used in attribute values like alt, title, or placeholder.
What are Unicode code points for emojis?
Unicode code points are hexadecimal values representing emojis, such as 😀. Use these codes to insert emojis in HTML.
How do you display emojis using Unicode in HTML?
Use numeric character references like 😊 or hexadecimal references like 😊 to display emojis.
Are emojis universally supported across browsers?
Most modern browsers and devices support emojis, but appearance and availability may vary based on operating system and browser.
Similar Reads
HTML Tutorial
HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. It tells the web browser how to display text, links, images, and other forms of multimedia on a webpage. HTML sets up the basic structure of a website, and then CSS and JavaScript
10 min read
HTML Introduction
HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. HTML is a markup language, not a programming language, meaning it annotates text to define how it is structured and displayed by web browsers.It forms the building blocks of all we
5 min read
HTML Editors
An HTML Editor is a software application designed to help users create and modify HTML code. It often includes features like syntax highlighting, tag completion, and error detection, which facilitate the coding process. There are two main types of HTML editors: Text-Based Editors - Allow direct codi
5 min read
HTML Basics
HTML (HyperText Markup Language) is the standard markup language for creating and structuring web pages. It defines the structure of a webpage using elements and tags.HTML is responsible for displaying text, images, and other content.It serves as the foundation for building websites and web applicat
6 min read
HTML Comments
HTML comments are used to add notes or explanations in the HTML code that are not displayed by the browser. They are useful for documenting the code, making it easier to understand and maintain.To add a comment, use the syntax <!-- your comment here -->. [GFGTABS] HTML <!-- This is a commen
4 min read
HTML Elements
An HTML Element consists of a start tag, content, and an end tag, which together define the element's structure and functionality. Elements are the basic building blocks of a webpage and can represent different types of content, such as text, links, images, or headings. For example, the <p> el
5 min read
HTML Attributes
HTML Attributes are special words used within the opening tag of an HTML element. They provide additional information about HTML elements. HTML attributes are used to configure and adjust the element's behavior, appearance, or functionality in a variety of ways. Each attribute has a name and a value
9 min read
HTML Headings
HTML headings are used to define the titles and subtitles of sections on a webpage. They help organize the content and create a structure that is easy to navigate. Proper use of headings enhances readability by organizing content into clear sections.Search engines utilize headings to understand page
4 min read
HTML Paragraphs
A paragraph in HTML is simply a block of text enclosed within the <p> tag. The <p> tag helps divide content into manageable, readable sections. Itâs the go-to element for wrapping text in a web page that is meant to be displayed as a distinct paragraph. Syntax: <p> Content</p
5 min read
HTML Text Formatting
HTML text formatting refers to the use of specific HTML tags to modify the appearance and structure of text on a webpage. It allows you to style text in different ways, such as making it bold, italic, underlined, highlighted, or struck-through. Table of Content Categories of HTML Text FormattingLogi
4 min read