Viewport meta 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
- Add the tag once inside the <head> of every page template.
- Use width=device-width, initial-scale=1 unless you have a specific reason not to.
- Do not disable zoom with user-scalable=no or maximum-scale=1.
- 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
<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 means Google crawls and indexes the mobile version of your pages and uses it for ranking, on mobile and desktop alike.
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 is how quickly a page loads, shows its content and responds to input. Google measures it mainly through Core Web Vitals.
Technical SEO is making sure search engines can crawl, render and index your site, covering speed, redirects, canonicals, sitemaps and mobile.