# How to declare the character encoding

> Declaring UTF-8 in the first 1024 bytes stops browsers from guessing and prevents garbled characters.

Best practices · HTML version: https://getreport.app/learn/charset

## Character encoding declaration

Passing looks like: Character encoding is declared early.

**Why it matters.** Browsers need to know the encoding before they read the text. When it is missing or declared late, accented letters such as č, ć and š can appear as garbage and the page re-renders.

**How to fix it.**

1. Put <meta charset="utf-8"> as the first element inside <head>, within the first 1024 bytes of the document.
2. Or send it in the response header: Content-Type: text/html; charset=utf-8.

Check your own page: https://getreport.app/
