Meta Viewport Generator
Build a viewport meta tag and see which options harm accessibility before you ship them.
Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.
What the Meta Viewport Generator does
This meta viewport generator will build a viewport meta tag and see which options harm accessibility before you ship them. Paste your text in, pick the options you need, and copy the result straight back out. It is most often used for adding the viewport tag to a new page. People using this often want the base64 encoder and decoder next.
How to use it
- Leave width at device-width unless you have a specific reason not to.
- Keep initial scale at 1.
- Leave zoom enabled.
- Copy the tag into the head of your document.
How it works
Without a viewport meta tag, mobile browsers assume a desktop-width layout viewport — typically 980 pixels — and scale the whole page down to fit, which is why an unprepared site renders as a tiny unreadable version of its desktop self.
width=device-width, initial-scale=1 is correct for virtually every responsive site, and there is rarely a reason to deviate from it.
The one option worth arguing about is user-scalable=no. It blocks pinch zoom, which fails WCAG 2.1 criterion 1.4.4 and is a genuine barrier for anyone with low vision. iOS Safari has ignored it since iOS 10 precisely because it was so widely misused; Android browsers still honour it. There is no good reason to set it — the usual motivation, preventing accidental zoom on a web app, is better solved with touch-action in CSS.
viewport-fit=cover is only for notched and rounded screens, and only makes sense alongside the safe-area-inset environment variables in CSS. Without those, content ends up underneath the notch and the home indicator.
When to use it
- Adding the viewport tag to a new page.
- Checking whether an existing viewport tag has accessibility problems.
- Setting up viewport-fit for a notched screen layout.
- Understanding why a page renders tiny on mobile.
Common mistakes to avoid
- Setting user-scalable=no, which fails WCAG and blocks zoom for people who need it.
- Using a fixed width instead of device-width.
- Adding viewport-fit=cover without the corresponding safe-area CSS.
Frequently asked questions
What is the correct viewport meta tag?
width=device-width, initial-scale=1 for almost every responsive site. There is rarely a reason to add anything else.
Is user-scalable=no bad?
Yes. It blocks pinch zoom, fails WCAG 2.1 criterion 1.4.4, and iOS Safari has ignored it since iOS 10 because it was so widely misused.
What does viewport-fit=cover do?
Extends the layout under a notch and home indicator on devices that have them. It needs the safe-area-inset environment variables in CSS, or content sits under the hardware.