Developer tools

Viewport Meta Tag Generator

Choose the right width, scale limits and user-scaling behavior, then copy a correct viewport meta tag for your responsive page.

How to use the viewport meta tag generator

  1. Choose your widthUse device-width for responsive sites, or a fixed pixel width for special cases.
  2. Set scale limitsAdjust initial, minimum and maximum zoom, and whether users can zoom at all.
  3. Copy the tagPaste the generated meta tag into your page's head section.

Getting the viewport tag right

The viewport meta tag tells mobile browsers how to scale your page. Getting it wrong is one of the most common causes of a site looking zoomed out or broken on phones.

device-width

Matches the viewport to the device's actual width in CSS pixels, the foundation of responsive design.

initial-scale

Sets the starting zoom level when the page loads, almost always left at 1.

Scale limits

Minimum and maximum scale bound how far users can pinch-zoom in either direction.

viewport-fit

Controls whether content can extend into the safe areas around notches on modern devices.

Viewport Meta Tag Generator FAQ

Why is the viewport meta tag needed?

Without it, mobile browsers render pages at a default desktop-like width and zoom out, which breaks responsive CSS layouts designed around the device's real width.

Should I disable user scaling?

Generally no. Preventing zoom hurts accessibility for users who need to enlarge text, so leave user-scalable=yes unless you have a specific, well-justified reason not to.

What does viewport-fit=cover do?

It lets your page content extend into the safe areas around notches and rounded corners on devices like modern iPhones, which you then handle with CSS environment variables.

What is the most common viewport tag?

width=device-width, initial-scale=1 is the standard baseline used by the vast majority of responsive websites.

Where does this tag go in my HTML?

It belongs inside the head section of your HTML document, ideally near the top alongside your charset declaration.

Try other free tools

More handy tools from My Panda Toolbox.