HTML · The document layer

What are meta tags used for?

Mediummeta tagsmetadataseoUpdated Oct 2026
Quiz this track

Short answer

Meta tags in the head describe the document, such as charset, viewport, description and robots. They are not visible but affect rendering, indexing and link previews.

A meta element is a name-value pair that gives the browser or a crawler information about the page. Some meta tags are consumed by browsers, some by search engines, and some by social platforms.

html
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
  name="description"
  content="Practice HTML, CSS and JavaScript interview questions."
/>
<meta name="robots" content="index, follow" />

Common categories

  • Encoding and rendering: charset and viewport
  • Search: description and robots
  • Social sharing: Open Graph and Twitter card tags
  • Verification: site ownership tags for search consoles
  • Legacy tags such as keywords are largely ignored by modern search engines

The description does not directly change rankings, but it often becomes the snippet in search results. Write it as a clear summary rather than a list of keywords.

Meta tags are hints, not commands. Crawlers can ignore them, and a social platform may cache an old preview until it refetches the page.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1Does the meta description affect ranking?
  2. 2What is the difference between meta robots and robots.txt?
  3. 3Which meta tags affect social sharing?
  4. 4Why is the charset meta tag important?

Say it in the interview

Meta tags describe the document in the head. Some, like charset and viewport, affect how the browser renders the page. Others, like description and robots, affect how search engines index and display it. Open Graph tags control link previews. I write a meaningful description because it is often used as the search snippet, and I remember that crawlers treat these as hints, not guarantees.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live HTML mock interview and get scored feedback on depth, clarity and confidence.