---
id: 670839051794aa19fcef6dc8
title: What Is UTF-8 Character Encoding, and Why Is It Needed?
challengeType: 19
dashedName: what-is-utf-8-character-encoding
---

# --description--

UTF-8, or UCS Transformation Format 8, is a standardized character encoding widely used on the web. Character encoding is the method computers use to store characters as data. Essentially, all text on a web page is a sequence of characters stored as one or more bytes. In computing, a byte is a unit of data consisting of 8 bits, or binary digits. UTF-8 supports every character in the Unicode character set, and this includes characters and symbols from all writing systems, languages, and technical symbols. Here is an example of using the `meta` element with the `charset` attribute to set the character encoding to `UTF-8`:

```html
<meta charset="UTF-8" />
```

By setting the character encoding to UTF-8, it will ensure that the accented `"e"` character (`é`) is displayed correctly on the page. Here is an extended code example of using the UTF-8 character encoding:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Examples of the UTF-8 encoding</title>
  </head>
  <body>
    <p>Café</p>
  </body>
</html>
```

For each new project you create, you should include this `meta` element with the `charset` attribute set to `UTF-8`.

# --questions--

## --text--

Which attribute is used to set the UTF-8 character encoding for HTML documents?

## --answers--

`pattern`

### --feedback--

Refer back to the examples showing which attribute to use.

---

`content`

### --feedback--

Refer back to the examples showing which attribute to use.

---

`charset`

---

`lang`

### --feedback--

Refer back to the examples showing which attribute to use.

## --video-solution--

3

## --text--

What is character encoding?

## --answers--

A method computers use to store characters as data.

---

A way to compress text files.

### --feedback--

Think about what computers do with characters.

---

It determines the font used to display text on a screen.

### --feedback--

Think about what computers do with characters.

---

It refers to the process of converting spoken language into written text.

### --feedback--

Think about what computers do with characters.

## --video-solution--

1

## --text--

How many bits are in a byte?

## --answers--

1

### --feedback--

Refer back to the information about bytes and bits.

---

33

### --feedback--

Refer back to the information about bytes and bits.

---

7

### --feedback--

Refer back to the information about bytes and bits.

---

8

## --video-solution--

4
