MobileCheck

The viewport meta tag: what it does and the one line you need

Updated October 17, 2026 · Covers: The site is not mobile-friendly The page width is fixed

What it means

The viewport meta tag is a single line in the <head> of your page that tells mobile browsers how wide the layout should be and how much to zoom in when the page first opens. This is the version almost every site should use:

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

MobileCheck reports two problems related to this tag:

Both lead to the same result: the phone lays the page out wider than its screen and then shrinks the whole thing to fit.

Why it matters

Mobile browsers were built to cope with a web designed for desktop monitors. When a page doesn't say how wide it wants to be, Safari on iPhone and Chrome on Android assume it is a desktop page and lay it out on a virtual canvas about 980 CSS pixels wide. A typical phone is 360–430 CSS pixels wide, so the browser scales that 980px layout down to less than half its size.

The page technically fits, but everything is tiny. 16px body text ends up looking like 6–7px text. Buttons become specks. Visitors have to pinch-zoom and pan around to read a single paragraph. Your responsive CSS doesn't help either: media queries such as @media (max-width: 600px) never match, because the browser reports a layout width of 980px, not the real screen width.

A fixed width like width=1024 or width=600 does the same thing with a different number. The page is laid out at that width and scaled to fit, so text is smaller than you designed it and your mobile styles may never apply.

This is also the first thing to fix for search. Google uses mobile-first indexing, meaning it crawls and evaluates the mobile version of your pages. A page without a viewport tag is, by any practical definition, not mobile-friendly.

What each attribute does

The content attribute is a comma-separated list of settings. Here is what each one controls:

AttributeWhat it doesRecommendation
widthThe width of the layout viewport. device-width means the width of the screen in CSS pixels.Always width=device-width.
initial-scaleThe zoom level when the page loads. 1 means one CSS pixel equals one device-independent pixel.Use initial-scale=1.
minimum-scaleHow far people can zoom out.Leave it out.
maximum-scaleHow far people can zoom in.Leave it out. Values below 2 block zoom for people who need it.
user-scalableWhether pinch-zoom is allowed at all.Leave it out. Never set no.
viewport-fitWhether the page extends under rounded corners and notches. cover fills the whole screen.Only if you also pad content with env(safe-area-inset-*).
interactive-widgetHow the on-screen keyboard affects the viewport (Chromium browsers only).Optional; the default is fine for most sites.

Why width=device-width and initial-scale=1 together

width=device-width is the important part: it makes the layout viewport match the screen, so a 390px-wide iPhone gets a 390px layout and your media queries work as written. initial-scale=1 sets the starting zoom so the page isn't scaled up or down on load. Using both is the long-standing, widely recommended combination because it gives consistent results across browsers, including when the phone is rotated to landscape and the page has to reflow to the new width.

The tag on its own does not make a site responsive. It only stops the browser from pretending to be a desktop. If your layout uses fixed pixel widths, it will now stick out past the edge of the screen instead of being shrunk. That is progress, because the problem is now visible and fixable, and the guide to content wider than the screen covers the next step.

How MobileCheck finds it

For every device in your report, MobileCheck loads the page in a real browser engine with that device's actual CSS viewport: WebKit for iPhones and iPads, Chromium for Android phones and tablets. It reads the viewport tag and measures how much the browser had to scale the page down to fit.

When either problem is present, measured text sizes reflect the scaled-down rendering, so you will usually see small-text warnings at the same time. Fix the viewport first; many of those warnings disappear with it.

How to fix it

Add the tag inside <head>, ideally near the top, right after the charset declaration:

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Your page</title>
</head>

If you already have a tag with a fixed width, replace the whole content value rather than adding a second tag. If your tag contains user-scalable=no or maximum-scale=1, remove those too; the guide to disabled zoom explains why.

A few platform notes:

If you want edge-to-edge design on phones with notches, add viewport-fit=cover and keep content clear of the rounded corners with safe-area padding:

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

header {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

How to check the fix

View the page source on your live site and confirm there is exactly one viewport tag with width=device-width. Then run the free mobile-friendly check again: the viewport problem should be gone and the screenshots should show text at its real size. To scroll and tap through the page yourself, open it in the live mobile preview.

Test on both engines. Chrome DevTools device mode always renders with Chromium, even when you pick an iPhone, so it can't show you Safari-specific behaviour. MobileCheck runs iPhones on WebKit, so you see what Safari users see. If you are unsure which screen widths to test, the list of common mobile viewport sizes is a good starting point.

Frequently asked questions

What is the correct viewport meta tag?

For almost every site it is <meta name="viewport" content="width=device-width, initial-scale=1"> placed inside the head. It makes the layout match the screen width and starts the page at normal zoom.

What happens if a page has no viewport meta tag?

Mobile browsers lay the page out about 980 CSS pixels wide, as if it were a desktop page, and shrink it to fit the screen. Text becomes tiny and media queries for small screens never apply.

Does the viewport tag make my site responsive?

No. It only tells the browser to use the real screen width. Your CSS still has to adapt the layout to narrow screens, for example with flexible widths and media queries.

Related guides