HTML entities

Some characters are reserved in HTML and they have a special meaning. To use these reserved characters, we use HTML entities.

HTML entities

What are HTML entities?

Some characters are reserved in HTML. For example, if you use < or > symbols in your text, the browser may assume them as the markup. To solve this issue, you can use HTML entities.

Example

<!DOCTYPE html>
<html>
<head>
    <title>HTML entities</title>
</head>
<body>
    <h4>This will be shown as a heading</h4>
    &lt;h4&gt;This will be shown as the markup&lt;/h4&gt;
</body>
</html>

Output

This will be shown as a heading

<h4>This will be shown as the markup</h4>

Frequently used HTML entities

SymbolEntityDescription
<&lt;Less than
>&gt;Greater than
&&amp;Ampersand
&nbsp;Non-breaking space
'&apos;Apostrophe
"&quot;Quotation mark
~&tilde;Tilde
©&copy;Copyright
®&reg;Registered trademark
&trade;Trademark
&euro;Euro
£&pound;Pound
¢&cent;Cent
¥&yen;Yen

Share Tweet Send
Loading...