meta charset
Declares the character encoding of the HTML document — UTF-8 is the universal standard.
The charset declaration tells the browser how to interpret the bytes of the HTML document. Without it, browsers apply heuristics to guess the encoding, which can cause garbled characters (mojibake) for non-ASCII content (accented characters, non-Latin scripts, special symbols).
UTF-8 is the correct encoding for virtually all modern web pages — it supports every character in Unicode, including all Latin, Cyrillic, Chinese, Arabic, and other scripts. It is the default for HTTP/1.1 and required for HTML5 documents.
The charset meta tag must be within the first 1024 bytes of the document to be effective. Place it as the first element inside <head>, before the <title> tag. This ensures the browser reads the encoding declaration before encountering any characters that need to be decoded.
HTML Example
<meta charset="UTF-8">