Skip to the page
html reference · document

HTML <meta charset="utf-8">

closing tag
none — void element
void element
yes
lives inside
<head>
typically holds
n/a (self-contained)

Where it goes

The very first line inside <head>. The browser needs it before it reads any other text on the page.

Example

<head>
  <meta charset="utf-8">
</head>

Open this example in the editor →

Common mistakes

  • Leaving it out. Plain English usually survives. It is the first thing to check when accents or emoji show up broken.
  • Putting it after <title>. The browser may have already guessed the wrong character set and read the title with it. It belongs first.
  • Writing </meta>. There is nothing to close.

Related

Updated 24 October 2026. Practice it in the html route, or read more on MDN.