ForHosting KIT · Web Scraping & Monitoring

Viewport meta tag generator for responsive web pages

Generate a responsive viewport meta tag without recalling its exact attribute order or punctuation.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Choose device-width for the standard mobile-friendly declaration, or enter a positive numeric width for a deliberate fixed viewport, then set the initial scale. The result includes a complete HTML tag ready to copy into a document head, its content value, and normalized settings that are convenient for scripts, templates, tests, and automated build pipelines across projects.

Choose the viewport width deliberately

A viewport declaration tells a mobile browser how the page's layout viewport should relate to the screen. For most responsive sites, device-width is the right setting because it follows the device's CSS-pixel width and lets media queries respond to the available space. This generator also accepts a positive numeric width when a controlled, fixed layout viewport is genuinely required, such as a legacy embedded interface, a reproducible browser fixture, or a compatibility test. Enter the number without a px suffix: 375 is valid, while 375px is not a viewport width value in this declaration. Zero, negative values, empty input, non-finite values, and arbitrary words are rejected instead of being placed into markup that looks plausible but does not express the requested setting. The returned width is normalized, so numeric text such as 375 becomes the stable content fragment width=375. This narrow validation makes the output useful in automation: success means the width is either the exact standard keyword or a positive number, with no hidden spelling correction or browser-dependent guesswork.

Set initial scale and copy the generated tag

The initial scale controls the zoom level when the page first loads. A value of 1 is the conventional choice: one CSS pixel maps to one viewport CSS pixel before the user zooms. The field defaults to 1, but another positive finite number can be supplied for a specific testing or application requirement. The generator validates that setting separately and preserves its numeric meaning in a stable textual form. It then produces a complete tag such as <meta name="viewport" content="width=device-width, initial-scale=1">. Place that tag inside the document's head, ideally once, rather than appending multiple viewport declarations whose interaction may differ between browsers. The response also exposes the content string and normalized width and initial_scale fields. Use meta_tag when writing HTML, content when a framework expects only the content attribute, and the individual fields when asserting configuration in tests. No network request, page inspection, or user-agent detection changes the result; identical input always returns identical output in the browser and through the API.

Understand what the generator does not add

This capability intentionally generates only width and initial-scale. It does not add maximum-scale, minimum-scale, user-scalable, viewport-fit, interactive-widget, or other optional directives, because those settings require product and accessibility decisions rather than automatic defaults. In particular, restricting user zoom can make content harder to use for people who need magnification, so a small tag generator should not silently introduce that behavior. The tool also does not audit an existing page, detect duplicate tags, test responsive breakpoints, or prove that the CSS itself is responsive. It creates deterministic markup from the two supplied settings. After adding the result, inspect the page at narrow and wide sizes, confirm that text remains readable, verify that controls do not overflow, and test zoom on real browsers. For templated projects, keep the generated declaration in the shared head component so each route receives the same policy. Interactive use on this page runs free in the browser; an automated API request costs $0.002. Because the same pure solver serves both paths, a tag tested manually can move into a build script without changing its formatting or validation rules.

Start a responsive page

Create the standard device-width and initial-scale declaration for a new HTML document or shared layout template.

Build deterministic fixtures

Generate a fixed numeric viewport declaration for browser tests that need an explicit, reproducible layout width.

Normalize configuration output

Turn form or script settings into one stable tag and separate normalized fields for validation and snapshot tests.

What width should a responsive website use?

Use device-width in the usual responsive design case. It follows the device's viewport width in CSS pixels.

Can I enter a fixed width?

Yes. Enter a positive number such as 375 without a unit suffix. Zero, negative, non-finite, and nonnumeric values are rejected.

What initial scale should I use?

A value of 1 is the conventional default. Another positive finite number is accepted when your project has a specific requirement.

Does the result disable zoom?

No. The generator does not add user-scalable, maximum-scale, or minimum-scale directives.

Where does the meta tag belong?

Place it once inside the HTML head. Avoid multiple competing viewport declarations in the same document.

How much does the API request cost?

Each successful API request costs $0.002; interactive execution on this page is free in the browser.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/web/viewport-meta-generate

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/web/viewport-meta-generate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"width":"device-width"}'
{
  "width": "device-width"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "web.viewport_meta_generate",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

timeout_sec30
max_crawl_pages25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →