Viewport Meta Tag Generator

Get the viewport meta tag right. Pick a preset — standard, edge-to-edge for notched phones, or keyboard-resizes-layout — or set each option yourself, and copy the finished tag. The generator warns you if a setting would stop people zooming, which is an accessibility failure. It runs in your browser.

Viewport options

OptionUse
width=device-widthAlways — lays out at the device's width
initial-scale=1Always — starts at 1:1
maximum-scale / user-scalableAvoid — blocks zoom
viewport-fit=coverEdge-to-edge designs on notched phones
interactive-widgetControl on-screen keyboard resizing

When to use it

  1. Make a new site render properly on phones.
  2. Fix a page that loads zoomed out on mobile.
  3. Go edge-to-edge on notched iPhones.
  4. Remove a zoom-blocking tag flagged in an accessibility audit.

How to Use

  1. Choose a preset or set the options.
  2. Read any warnings.
  3. Copy the tag into the <head> of every page.

Features

  1. Presets for common layouts
  2. viewport-fit and interactive-widget
  3. Zoom-blocking accessibility warnings
  4. Copy or download
  5. 100% client-side

FAQs

What viewport tag should I use?

<meta name="viewport" content="width=device-width, initial-scale=1"> — that's right for almost every site.

Should I disable zoom?

No. user-scalable=no or a low maximum-scale blocks people with low vision from zooming, fails WCAG, and iOS ignores it anyway.

What does viewport-fit=cover do?

It lets your page draw under the notch and rounded corners. You then need padding using env(safe-area-inset-top) and friends so content isn't hidden.

What is interactive-widget?

It controls how the on-screen keyboard affects layout in Chrome on Android — useful if a fixed footer or chat box jumps when the keyboard opens.

Is my data uploaded?

No. The tag is generated in your browser.

Technical Details

Without a viewport meta tag, mobile browsers assume a desktop page and lay it out at around 980 CSS pixels wide before shrinking it to fit, so text is tiny and media queries never trigger. width=device-width with initial-scale=1 tells the browser to use the device's real width at 1:1, which is all most sites need. The generator builds the content attribute from the options that are set and leaves the rest out, because every unnecessary option is a chance to break something. It warns on the two settings that cause real harm: user-scalable=no and a maximum-scale below 5 stop people pinching to zoom, which fails WCAG 1.4.4 Resize Text and is ignored by iOS Safari anyway. viewport-fit=cover extends the page under a phone's notch and rounded corners, which then needs padding from the env(safe-area-inset-*) CSS variables, and the tool says so. interactive-widget controls whether the on-screen keyboard resizes the visual viewport, the layout viewport, or overlays the page, which matters for layouts with fixed footers. The tag is generated in the page.

Web & CSS Tools

Web & CSS Tools

  • Web App Manifest Generator
  • CSS Button Generator
  • CSS Text Shadow Generator
  • Glassmorphism Generator
  • Neumorphism Generator
  • CSS Filter Generator
  • CSS Loading Spinner Generator
  • CSS Toggle Switch Generator