The <meta charset="UTF-8"> tag specifies the character encoding for the HTML document, telling the browser how to interpret and display text correctly.
Why It’s Important
- Ensures that all characters, including special symbols, emojis, and non-Latin scripts, render correctly.
- Prevents garbled or unreadable text (like �) on the webpage.
- Must be included in the
<head>section before any text content.
Example
<head>
<meta charset="UTF-8">
<title>My Website</title>
</head>
- Using UTF-8 is recommended because it supports almost all characters from every language.
💡 In Short:
<meta charset="UTF-8">ensures your webpage displays all characters properly, making it compatible with international text and symbols.