Skip to content

Viewport meta tag

Also called meta viewport, viewport tag

What is viewport meta tag?

The viewport meta tag is an HTML tag in the head of a page that tells mobile browsers how wide the layout should be and how to scale it. The standard value, width=device-width, initial-scale=1, makes the page as wide as the screen and starts it at normal zoom, so responsive CSS works.

Without the tag, most mobile browsers assume the page was built for a desktop and render it on a virtual canvas around 980 pixels wide, then shrink it to fit. Text becomes tiny, tap targets crowd together and people have to pinch and zoom. Your responsive CSS media queries also stop working as intended, which undermines page speed work and mobile layouts alike, because the browser reports the wide virtual width instead of the real screen width.

Why viewport meta tag matters for SEO

Google uses the mobile version of pages for indexing and ranking (mobile-first indexing), and a page that is not usable on a phone gives searchers a poor experience. Lighthouse checks for the tag in its SEO and best practices audits.

Avoid user-scalable=no and low maximum-scale values. Blocking zoom stops people with low vision from enlarging text, and accessibility checks flag it.

How to add a viewport meta tag

  1. Add the tag once inside the <head> of every page template.
  2. Use width=device-width, initial-scale=1 unless you have a specific reason not to.
  3. Do not disable zoom with user-scalable=no or maximum-scale=1.
  4. Test the page on a real phone or in your browser’s device mode to check that text is readable without zooming.

Viewport meta tag example

HTML
<meta name="viewport" content="width=device-width, initial-scale=1">

Viewport meta tag FAQ

Is the viewport meta tag needed for SEO?

It is needed for a usable mobile page, and Google indexes the mobile version of your site. It is not a ranking factor on its own, but a page without it gives mobile searchers a poor experience.

Should I use user-scalable=no?

No. It stops people zooming in, which harms accessibility. Modern browsers handle tap delays without it.

Related SEO terms

  • Mobile-first indexing

    Mobile-first indexing means Google crawls and indexes the mobile version of your pages and uses it for ranking, on mobile and desktop alike.

  • Lighthouse

    Lighthouse is Google’s open-source tool that tests a page in a lab and scores its performance, accessibility, best practices and SEO.

  • Page speed

    Page speed is how quickly a page loads, shows its content and responds to input. Google measures it mainly through Core Web Vitals.

  • Technical SEO

    Technical SEO is making sure search engines can crawl, render and index your site, covering speed, redirects, canonicals, sitemaps and mobile.

Back to the SEO glossary

Put the terms to work

Every term here is something OpenSEO measures. It is open source: start online in a minute, or run it on your own server.