# The encoding “utf8” is not the preferred name of the character encoding in use. The preferred name is “utf-8”. (Charmod C024)

> Canonical HTML version: https://rocketvalidator.com/html-validation/the-encoding-utf8-is-not-the-preferred-name-of-the-character-encoding-in-use-the-preferred-name-is-utf-8-charmod-c024
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `charset` meta tag specifies an encoding name that is not the preferred form. Use `utf-8` (with a hyphen) instead of `utf8`.

The HTML specification requires that character encoding declarations use the preferred IANA encoding name. For the Unicode UTF-8 encoding, the preferred name is `utf-8`, not `utf8`, `UTF8`, or other variations. While browsers may still recognize non-preferred names, the W3C validator flags them because the [WHATWG HTML standard](https://html.spec.whatwg.org/multipage/semantics.html#charset) and [IANA character set registry](https://www.iana.org/assignments/character-sets/character-sets.xhtml) both list `utf-8` as the canonical form.

This applies to the `<meta charset>` declaration and, less commonly, to `charset` parameters in `Content-Type` headers or `<meta http-equiv>` tags.

## Incorrect example

```html
<meta charset="utf8">
```

## Correct example

```html
<meta charset="utf-8">
```
