HTML Basics

HTML Charsets

A character set (charset) defines how bytes are turned into the letters and symbols you see. Declaring the right one prevents strange, garbled characters.


What is a Character Set?

Computers store text as numbers. A character set is the map that connects each number to a specific character. If the browser guesses the wrong map, you get broken text like ' instead of an apostrophe.

Declaring the Charset

Always declare the charset as the first thing inside the head. The modern standard is UTF-8, which supports virtually every language and symbol.

Set UTF-8 encoding
<head>
  <meta charset="UTF-8">
  <title>My Page</title>
</head>

Common Character Sets

CharsetDescription
UTF-8Unicode covering nearly all languages; the recommended default
ASCIIThe original set: English letters, digits, and basic symbols only
ISO-8859-1An older Western European set (Latin-1), now largely replaced by UTF-8
⚠️

Place the charset meta tag within the first 1024 bytes of the document, ideally as the very first line inside head. Declaring it late can cause the browser to reload and re-parse the page.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships