You should always explicitly declare the character encoding of your HTML documents. If you don't, you might witness unexpected behaviour.
This is the bare minimum I would use for a valid document:
<meta name="viewport" content="width=device-width, initial-scale=1">
If you run it through the W3C Markup Validation Service, you'll see that it's fully valid HTML with no errors or warnings.
If you omit the
<meta charset="utf-8"> element, the Web Console in Firefox will show an error:
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
It's still "valid" HTML if you omit it, but why make your page more fragile?
If you're also using non-ASCII characters in your CSS, it might be worth adding the
@charset at-rule to the top of your stylesheet as well:
The MDN Web Docs explain that this is
useful when using non-ASCII characters in some CSS properties, like .