HTML Attributes

HTML charset attribute

Declares the encoding in a meta element. Place the declaration early in the document head, within the first 1024 bytes, and encode the file as UTF-8. Applicable elements include: <meta>. Check each element’s value rules.

Formal Syntax & Structure

html syntaxhtml
charset="utf-8"

Parameters & Attributes

NameTypeDescription
charsetUTF-8Declares the encoding in a meta element. Place the declaration early in the document head, within the first 1024 bytes, and encode the file as UTF-8.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>Encoding</title>  </head>  <body>Résumé</body></html>
HTML Reference