Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. HTML Tag Dictionary
  3. <meta>

<meta>

The <meta> tag specifies metadata about the document — such as character encoding, description, and viewport settings. Place it inside <head>. It does not affect what is directly displayed on the page, but it influences how browsers and search engines behave.

Syntax

<!-- Specify character encoding -->
<meta charset="UTF-8">

<!-- Combination of name and content attributes -->
<meta name="description" content="A description of the page.">

<!-- Specify viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- http-equiv attribute -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">

Attribute List

AttributeDescription
charsetSpecifies the character encoding of the document. Use UTF-8 for modern web pages.
nameSpecifies the type of metadata. Common values include description, keywords, and viewport.
contentSpecifies the value corresponding to the name or http-equiv attribute.
http-equivSpecifies information equivalent to an HTTP header. Common values include X-UA-Compatible.
propertyUsed with extended metadata such as OGP (Open Graph Protocol).

Common name Values

name valueDescription
descriptionA description of the page. May appear in search engine results.
keywordsKeywords for the page. Largely ignored by major modern search engines.
viewportControls the display settings on mobile devices such as smartphones.
robotsProvides instructions to search engine crawlers. Values include noindex and nofollow.
authorSpecifies the author of the page.

Sample Code

<head>
  <!-- Character encoding: always place this first inside <head> -->
  <meta charset="UTF-8">

  <!-- Viewport: required for smartphone support -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- Page description (shown in search results) -->
  <meta name="description" content="A beginner-friendly guide to using HTML.">

  <!-- OGP (controls how the page appears when shared on social media) -->
  <meta property="og:title" content="Page Title">
  <meta property="og:description" content="A description of the page.">
  <meta property="og:image" content="https://example.com/ogp.png">
</head>

Result

The code above does not produce any visible output on the page, but it communicates page information to browsers, social media platforms, and search engines. On smartphones, the viewport setting ensures the page is displayed at the appropriate width.

Notes

Always place <meta charset="UTF-8"> at the very beginning of <head>. If the character encoding declaration appears too late, the browser may misidentify the encoding and display garbled text.

<meta name="viewport" content="width=device-width, initial-scale=1.0"> is required for responsive design on smartphones. Without it, smartphones will render the page at a desktop width and scale it down.

OGP (property="og:...") is a mechanism that controls the title, description, and image displayed when a URL is shared on social media such as Facebook or X (formerly Twitter). It is a good idea to configure this when publishing a website.

Browser Support

Chrome Chrome
49+
Supported in all versions
Firefox Firefox
57+
Supported in all versions
Safari Safari
18+
Supported in all versions
Edge Edge
80+
11 or earlier ×
IE IE
11 or earlier ×
Opera Opera
48 or earlier ×
iOS Safari iOS Safari
18+
Supported in all versions
Android Browser Android Browser
37+
4 or earlier ×
Chrome Android Chrome Android
36+
17 or earlier ×
Firefox Android Firefox Android
79+
3 or earlier ×

If you find any errors or copyright issues, please .