Advertisement
Home Open Editor ❯

HTML <meta> charset Attribute

Example

<head>
  <meta charset="UTF-8">
  <!-- or -->
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

Try this code ❯

Meaning

The charset attribute is used to set the character encoding for the document like “UTF-8”.

This approach is an alternative to using the http-equiv method currently employed.


Standard Syntax

HTML: <meta charset="characterSet">
XHTML: <meta charset="characterSet" />


Advertisement

Attribute Values

Value Description
characterSet Specifies the character encoding for the document. The HTML5 specification recommend to use the UTF-8 character set!
Home Open Editor ❯
Advertisement