How to use emojis in HTML

Overview

HTML stands for HyperText Markup Language and is a standard markup language for creating websites.

Emojis are characters from the UTF-8 character set. We can use them to display as normal characters on HTML pages.

We cannot type emojis from the keyboard, but we can use entity numbers. For example, the entity number A is 65. In the same way, we can represent emojis as well.

Syntax

We should use &# before an entity number. For example, to display using an entity number, we display it as &#65.

Example

Display the emoji in HTML

Explanation

In the above code snippet, we used entity number 128151 to display the emoji, 💗.

Note: Since emojis are also characters, we can copy and paste them.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources