Viewport Meta Tag

What the viewport meta tag does, why it makes responsive design work on mobile, the correct configuration, the attribute reference, and common mistakes.

First published: Jul 2, 2026 · Last updated: Jul 18, 2026 · Advanced
demand #6 in Mobile SEO#142 in Technical SEO#194 on the site

The viewport meta tag — <meta name="viewport" content="width=device-width, initial-scale=1"> — hints to the browser to size the layout viewport to the device's width in CSS pixels instead of a legacy ~980px fallback some mobile browsers use. Without it, phones can render the page at that wider fallback and shrink it, producing tiny text, horizontal scroll, and responsive breakpoints that may not apply as intended. It's not a ranking factor itself, but its presence is one of the things Google documents as indicating mobile-friendliness, and its absence is a classic mobile usability failure. Never force user-scalable=no or a restrictive maximum-scale — it fails the W3C's accessibility conformance rule for zoom and can lock out low-vision users, though browsers can override it (iOS 10+ ignores it by default). Test it with Lighthouse or PageSpeed Insights: Search Console's Mobile Usability report and the Mobile-Friendly Test were retired December 1, 2023.

TL;DR — The viewport meta tagAn HTML head element — <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> — that hints mobile browsers to size the layout viewport to the device's width in CSS pixels instead of a legacy ~980px fallback, so responsive design works.<meta name="viewport" content="width=device-width, initial-scale=1"> — hints the browser to size the layout viewport to the device’s width in CSS pixels instead of a legacy ~980px fallback some mobile browsers use, which is what lets responsive CSS media queries evaluate against the device’s real width on mobile. Missing or misconfigured, it’s a classic mobile usabilityWhether a page is easy to use on a mobile/touch device — legible text without zooming, tap targets sized and spaced to avoid mis-taps, content that fits the viewport with no horizontal scrolling, and no intrusive interstitials. Distinct from mobile-first indexing and Core Web Vitals. failure (tiny text, horizontal scroll). It is not a ranking factor — Google documents its presence as one thing its mobile-friendliness evaluation checks for, and no more than that. Never force user-scalable=no / restrictive maximum-scale: it fails the W3C’s ACT accessibilityWeb accessibility means designing sites so people with disabilities can use them, per the W3C's WCAG guidelines. It overlaps with SEO in specific, checkable ways — alt text, heading structure, descriptive link text, captions, and page speed all serve both audiences — but Google has said accessibility itself is not a ranking factor, and most WCAG success criteria (keyboard focus order, ARIA live regions, form labels) have no SEO effect at all. rule for zoom, though browser overrides exist (iOS 10+ ignores it by default). Google and Bing recommend the identical tag. Test with LighthouseLighthouse is Google's free, open-source tool that audits a page under simulated lab conditions and scores it 0–100 across Performance, Accessibility, Best Practices, and SEO. It's lab data — useful for debugging, not a ranking signal. / PageSpeed InsightsPageSpeed Insights (PSI) is a free Google tool at pagespeed.web.dev that reports two kinds of data for a URL: real-user field data from the Chrome UX Report and a single Lighthouse lab run with the 0–100 Performance score. Only the field Core Web Vitals are what Google uses for ranking.Search ConsoleA free Google service that reports how a site performs in Google Search and surfaces problems with how Google crawls, indexes, and serves it. It's first-party data straight from Google — but you don't need it to appear in results.’s Mobile UsabilityWhether a page is easy to use on a mobile/touch device — legible text without zooming, tap targets sized and spaced to avoid mis-taps, content that fits the viewport with no horizontal scrolling, and no intrusive interstitials. Distinct from mobile-first indexing and Core Web Vitals. report and the Mobile-Friendly Test were retired December 1, 2023.

Evidence for this claim The viewport meta tag lets authors control viewport width and scaling so responsive layouts render at device width. Scope: Browser viewport behavior. Confidence: high · Verified: MDN: Viewport meta tag Evidence for this claim Pages should not disable browser zoom because users must be able to enlarge content for accessibility. Scope: WCAG resize-text requirement and viewport guidance. Confidence: high · Verified: W3C WAI: Understanding Resize Text

The problem it solves: the ~980px virtual viewport

To understand the tag you have to understand what it’s overriding. When mobile browsers were new, the lack of a viewport tag meant some of them would fall back to a fixed layout width of roughly 980px and render at that size — a deliberate accommodation so desktop-sized, pre-responsive sitesA mobile configuration that serves the same HTML on the same URL to every device and uses CSS media queries to adapt the layout to the viewport. It's Google's recommended setup and requires a correct viewport meta tag to work. wouldn’t completely break on early smartphones. The browser then scaled the result down to the physical screen. MDN’s own framing: “If the site isn’t designed to work well on small viewports and this tag is omitted, some mobile browsers render the site using a fixed initial containing block width, typically 980px.” — it’s a browser-specific fallback, not a universal spec constant.

The consequence, in Google’s own words: “Without a viewport meta tag, mobile devices render pages at typical desktop screen widths and then scale the pages down, making them difficult to read.” You get unreadable text, forced pinch-zooming, and horizontal scrolling — the textbook symptoms of a page flagged “not mobile-friendly.”

Setting the tag “lets you control the width and scaling of the viewport so that it’s sized correctly on all devices.”

Layout viewport vs. visual viewport (under the hood)

Two “viewports” are in play, and it’s worth keeping them straight:

  • The layout viewport is the area the page lays out into and that fixed-position elements attach to. width=device-width sets this to the device’s screen width in CSS pixels.
  • The visual viewport is what the user is currently looking at — which changes when they pinch-zoom. Zooming changes the visual viewport without changing the layout viewport.

The reason this matters for SEO and CSS: your responsive media queries (@media (max-width: 600px) and friends) are evaluated against the layout viewport. If the layout viewport is stuck at a legacy ~980px fallback because there’s no viewport tag, a phone may match your desktop breakpoints instead of your narrow ones. MDN puts it plainly: “Without it, your responsive design with breakpoints and media queries may not work as intended on mobile browsers.” The tag is what makes device-width the layout viewport so your intended breakpoints evaluate correctly.

The correct tag, and where it goes

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- ...the rest of your head... -->
</head>

Put it high in the <head>, near charset, before content-dependent tags. This is the value Google, Bing, and LighthouseLighthouse is Google's free, open-source tool that audits a page under simulated lab conditions and scores it 0–100 across Performance, Accessibility, Best Practices, and SEO. It's lab data — useful for debugging, not a ranking signal. all recommend — verbatim, it’s the fix Lighthouse itself suggests. Don’t overthink the value: width=device-width, initial-scale=1 is the answer for essentially every responsive site.

Attribute reference

The content attribute is a comma-separated list of directives. MDN is the canonical attribute-by-attribute reference; here’s what each one does:

DirectiveWhat it doesNotes
widthControls the (minimum) pixel width of the viewportA whole number 1–10000, or the special value device-width (the screen width in CSS pixels). Use device-width.
initial-scaleThe zoom ratio between device width and viewport on loadA number 0.010.0. Use 1.
minimum-scaleThe minimum zoom level allowedMust be ≤ maximum-scale. iOS 10+ ignores it by default.
maximum-scaleThe maximum zoom-in allowedMust be ≥ minimum-scale. iOS 10+ ignores it by default. Don’t restrict it.
user-scalableWhether the user can zoom (yes/no, default yes)iOS 10+ ignores it by default. Setting no is an accessibility anti-pattern — leave it.
interactive-widgetHow interactive UI (e.g. virtual keyboards) affect the viewportValues: resizes-visual (default), resizes-content, overlays-content. Newer; most SEO content omits it.
viewport-fitHow the viewport handles display cutouts (notches)Values: auto (default), contain (fits inside the largest rectangle that avoids the cutout), cover (fills the display — pair with CSS env() safe-area-inset variables so content doesn’t land under the cutout).

viewport-fit and interactive-widget are both browser-layout edge cases — display-cutout and virtual-keyboard handling, respectively — not SEO directives; most SEO-focused guides skip them entirely.

A small but real gotcha from Lighthouse’s own docs: setting initial-scale below 1 can trigger a legacy double-tap-to-zoom behavior that adds interaction delay — another reason to stick with initial-scale=1 rather than getting clever.

Never disable zoom: user-scalable=no is an anti-pattern

You’ll still find user-scalable=no (or maximum-scale=1) copy-pasted into old theme boilerplate, usually from a developer who didn’t want pinch-zoom “messing up” their layout. It’s wrong on two counts:

  1. It fails the web’s own accessibility conformance test for zoom, and it works against WCAG’s intent. The W3C’s ACT rule “Meta viewport allows for zoom” (rule b4f0c3) applies to any viewport tag that sets user-scalable or maximum-scale, and its expectation is explicit: the tag must not set user-scalable=no, and maximum-scale must not be set below 2. (The rule carries stated assumptions — it doesn’t apply if the page has no visible content, offers another way to resize text, or never needs to reflow past a 320×256 CSS-pixel area — but a typical responsive page doesn’t meet those exceptions.) Per MDN: “Disabling zooming capabilities by setting user-scalable to a value of no prevents people experiencing low vision conditions from being able to read and understand page content. Additionally, WCAG requires a minimum of 2× scaling; however, the best practice is to enable a 5× zoom.” Blocking zoom locks out the exact users who need it most.
  2. It’s also browser-specific, not universal. iOS Safari 10 and later ignore user-scalable=no and restrictive maximum-scale by default — that’s an iOS override, not a change to the ACT rule or to WCAG’s intent. So on a large share of mobile traffic the setting accomplishes nothing, while on browsers that do still honor it (older Android WebViews, some in-app browsers) it actively fails the accessibility test above. Zero upside, real downside — and don’t treat “iOS ignores it” as proof the markup is accessible everywhere.

The rule is simple: don’t touch zoom. width=device-width, initial-scale=1 and nothing else.

Is it a ranking factor?

Be precise here, because a lot of SEO content overstates it. Here’s exactly what Google documents, and where the line to industry inference sits.

What Google documents: the viewport tag is not a direct ranking factor. Google’s own supported-meta-tags doc says plainly that “presence of this tag indicates to Google that the page is mobile friendly” — that’s the whole documented claim: presence signals mobile-friendliness. Google doesn’t document the tag as scored, as a renderingTurning HTML, CSS, and JavaScript into the final visual page and DOM. guarantee, or as proof a page’s responsive design is actually good.

Where practitioners connect the dots (industry inference, not a Google citation): a missing or misconfigured viewport tag is a common root cause of the mobile-usability failures (tiny text, horizontal scroll, unusable tap targets) that SEOs generally understand to degrade mobile page experienceGoogle's three real-user UX metrics — LCP (loading), INP (responsiveness), and CLS (visual stability) — used by Google's ranking systems, with no official weight attached, measured on field data.. That connection is reasonable and widely held in the industry, but it’s a practitioner inference about why the tag matters — not something Google’s docs state as a ranking chain.

So the honest framing: the tag itself isn’t scored, and fix it because a page without it renders badly on phones — not because Google documents it as a ranking lever, direct or indirect. Keep this separate from mobile-first indexingGoogle's practice of using the mobile version of a page's content — crawled by Googlebot smartphone — for indexing and ranking. It is not a separate index and not a ranking boost. too: that’s a distinct Google Search concept about which version of your page Google primarily uses for indexingStoring a crawled page in the search index so it can appear in results. Crawled is not the same as indexed — Google selects what to keep, and indexing isn't guaranteed. and ranking; the viewport tag is about how that mobile HTML renders in a browser, full stop.

How to test it — the tooling changed in 2023

This is where most older guides are stale. On December 1, 2023, Google retired Search ConsoleGoogle's free tool for monitoring crawling, indexing, and search performance.’s Mobile Usability report, the Mobile-Friendly Test tool, and the Mobile-Friendly Test API (announced April 2023, confirmed complete that December). Google’s reasoning was that other tools had matured — “many other robust resources for evaluating mobile usability have emerged, including Lighthouse from Chrome.” So if a tutorial tells you to open Search Console → Mobile Usability to check your viewport, that report no longer exists.

Layer these checks rather than relying on one tool: confirm the tag exists in the raw served HTML (not just after JavaScript runs), confirm your responsive breakpoints actually apply at phone widths, test zooming to 200% without the layout breaking (the resize behavior WCAG’s intent is built around), and spot-check in more than one browser — an iOS Safari-only check can hide a zoom-restriction bug that Android or in-app browsers still enforce.

Your current toolkit:

  • Lighthouse (in Chrome DevTools). The relevant audit historically read “Does not have a <meta name="viewport"> tag with width or initial-scale — it fails unless the <head> has a meta name="viewport" whose content includes width=. As of Lighthouse 13 it’s folded into the “Optimize viewport for mobile” insight.
  • PageSpeed InsightsPageSpeed Insights (PSI) is a free Google tool at pagespeed.web.dev that reports two kinds of data for a URL: real-user field data from the Chrome UX Report and a single Lighthouse lab run with the 0–100 Performance score. Only the field Core Web Vitals are what Google uses for ranking. — runs Lighthouse plus field Core Web VitalsGoogle's three real-user UX metrics — LCP (loading), INP (responsiveness), and CLS (visual stability) — used by Google's ranking systems, with no official weight attached, measured on field data. data.
  • Chrome DevTools device toolbar — emulate phone dimensions and eyeball it.
  • Bing’s Mobile Friendliness Test Tool — Bing checks viewport and zoom-control configuration too, and recommends the same tag Google does.
  • View source / real-device check — sometimes the fastest test is to just look at the <head> on your phone.

Common mistakes

  • No tag at all (“viewport not set”) — the page renders at the legacy desktop-ish width and shrinks.
  • A hardcoded pixel width like width=1024 instead of device-width — a tag exists, but it still doesn’t match the page to the device. Lighthouse and real mobile-friendliness both want a usable width= value, not just any tag.
  • initial-scale below 1 — can trigger the legacy double-tap-zoom delay.
  • user-scalable=no / restrictive maximum-scale — copy-pasted from old boilerplate; accessibility anti-pattern, ignored on iOS anyway.

For where this sits in the broader mobile work — configuration, content parity, speed — see the mobile SEOMobile SEO is the practice of optimizing a site so it ranks well when crawled and indexed by a mobile (smartphone) user agent and delivers a fast, usable experience on phones. Since Google completed mobile-first indexing, the mobile version is the primary version Google uses for indexing and ranking — so mobile SEO is effectively baseline SEO for every site. hub, the mobile SEO checklist, and mobile-first indexing. For the tag itself as part of the wider on-page tag family, the meta tagsMeta tags are HTML elements in a page's head that pass metadata about the page to search engines and browsers. For SEO only a few matter — the title element, the meta description, and the robots meta tag — while meta keywords and most others are ignored. cluster is the map.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.