A free print-size calculator for your readers

One self-contained HTML file. Calculates the pixels needed for a print or the pixel density of an existing image from dimensions you enter. No upload, account, cookies, analytics, external fonts or remote code.

Package status: prepared for reuse. No hosted widget URL is claimed here. Upload the file to your own site or use a verified KeptStars-hosted URL once it has been published.

1. Copy the file

Upload print-size-widget.html and LICENSE.txt to your site, for example under /tools/. Serve the HTML as text/html; charset=utf-8. The calculator also works when opened locally.

2. Embed it

Replace the example path with the location where you uploaded the file. The example uses English (US).

<iframe
  src="/tools/print-size-widget.html?locale=en"
  title="Print size and resolution calculator"
  width="660" height="1100"
  style="width:100%;max-width:660px;border:0;display:block"
  loading="lazy"
  referrerpolicy="no-referrer"
  sandbox="allow-scripts allow-popups"
></iframe>

The widget reflows at 280 pixels wide. Keep normal iframe scrolling available; a narrow layout may be taller than 1,100 pixels. Set an appropriate height for your page. No parent-page script or automatic resize messaging is required. Do not add allow-same-origin to the sandbox: it is unnecessary.

If your host sets a policy that blocks all framing, allow embedding for this public widget file only. Keep the normal security settings for account, checkout and other private pages.

3. Choose a language

Use one of these exact locale values: en, en-gb, es, es-mx, it, fr, de. Unknown or omitted values use English (US). Localize the iframe’s title attribute for your readers.

/tools/print-size-widget.html?locale=es
/tools/print-size-widget.html?locale=de

What it calculates

Centimeters divided by 2.54 gives inches. Each side in inches multiplied by pixels per inch gives the required pixel count, rounded to the nearest whole pixel. For an existing image, pixel dimensions divided by print dimensions in inches gives horizontal and vertical ppi.

The calculator warns when image and print proportions differ. It does not crop or resample an image and does not evaluate its content. A 300 ppi target is a planning value, not a guarantee of print quality; confirm your printer’s requirements.

Bounds match the main calculator: positive print sides up to 10,000 cm or inches, resolution up to 10,000 ppi and whole-pixel image sides up to 1,000,000. A result smaller than one rounded pixel is rejected.

Privacy and indexing

Numbers stay in the iframe. The file makes no network requests, stores nothing and sends no messages to its parent page. Loading any hosted file still produces the ordinary request handled by that host; the widget adds no tracking.

The standalone widget carries noindex, follow because it accompanies the full printing guide. The optional visible credit opens the matching language’s guide at KeptStars. No page canonical is hard-coded on a publisher’s copy.

Reuse terms

The original widget is MIT licensed. You may edit or remove the visible KeptStars credit and link. No backlink, review, endorsement or account is required. Preserve the license notice in copies of the code. Logos, trademarks, artwork and third-party assets are outside this license and are not included.

Validate your copy

Run the included script with Node.js. Its basic checks have no external dependencies. Optional browser checks require an existing Playwright installation and browser.

node validate-widget.cjs
node validate-widget.cjs --browser

For a custom installation, set PLAYWRIGHT_MODULE to your Playwright package and optionally CHROME_PATH to a Chromium executable. The script checks formulas, bounds, all seven locales, labels and privacy constraints. Browser mode additionally checks 280-pixel layouts, keyboard submission, invalid inputs and absence of network requests, and saves screenshots.