Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 7 min read

How to Generate a Website Thumbnail Online: 4 Ways That Work

Originally published on the Site2PDF blog. You need a small picture of a website. It might be for a portfolio grid, a directory listing, a link preview or a client report. It should show the top of the page at a fixed s

Originally published on the Site2PDF blog.

You need a small picture of a website. It might be for a portfolio grid, a directory listing, a link preview or a client report. It should show the top of the page at a fixed size and look the same for every site.

This guide covers four ways to generate a website thumbnail, from one free manual capture to hundreds of automated ones. Each section says where the method breaks.

Quick answer

Method Best for Cost Where it breaks
Chrome DevTools Device Mode One or two thumbnails, by hand Free Manual; you resize every image yourself
Thumbnail URL services (thum.io, Microlink, ScreenshotOne) Thumbnails shown live on your own site Free tiers, then paid Quotas; the image depends on their servers
Your own Puppeteer + sharp script Dozens to thousands, full control Free (your machine's time) You maintain it; banners and ads get in
Full-length capture, then crop A clean master image you can reuse Free for single pages Gives a full page, not a ready thumbnail

What a good website thumbnail needs

A thumbnail is two steps. First you render the page in a browser window of a fixed size, then you shrink the result.

  • A fixed viewport. Pick one window size for every site, such as 1280 Γ— 800. If the sizes differ, the grid looks uneven.
  • Only the top of the page. A thumbnail shows what a visitor sees first. A full-page capture squeezed into 640 Γ— 400 is just a thin stripe.
  • The right output size. For link previews, Facebook recommends images of at least 1,200 Γ— 630 pixels, close to a 1.91:1 ratio, and 600 Γ— 315 as the minimum (Meta for Developers). For a portfolio or directory grid, 640 Γ— 400 (16:10) from a 1280 Γ— 800 viewport scales cleanly.
  • No clutter. Cookie banners, chat widgets and ad slots take up a big share of a small image.

Method 1: Chrome DevTools Device Mode (free, one at a time)

Chrome can capture a page at an exact size. You don't need an extension.

  1. Open the page and press F12 (Cmd+Option+I on a Mac).
  2. Click the device toolbar icon, or press Ctrl+Shift+M.
  3. Choose Responsive and type the size, for example 1280 Γ— 800.
  4. Open the More options menu (three dots) in the device toolbar and click Capture screenshot.

Chrome saves a PNG of exactly the visible area. The same menu has Capture a full size screenshot for the whole page (Chrome DevTools docs).

Where it breaks: every thumbnail is manual, and the PNG is still full size. You resize it in an image editor afterwards. Cookie banners stay in unless you close them first. This is fine for five sites and slow for fifty.

For the full-page version of this trick and its limits, see how to take a full page screenshot.

Method 2: Thumbnail URL services (live thumbnails on your site)

Some services return a thumbnail from a single URL. You put that URL in an <img> tag, and their servers render the page.

thum.io uses the simplest format. You put the options before the target address:

https://image.thum.io/get/width/600/crop/800/https://example.com

width is the thumbnail width and crop is the height of the original capture. The first 1,000 impressions a month are free without signing up. Setting the browser width (viewportWidth), waiting before capture, full-page images and mobile emulation need the "Better" plan, which has a $20 monthly minimum as of November 2026 (thum.io docs, thum.io).

Microlink returns a screenshot alongside other page data when you add screenshot=true to an API call. The free plan allows 25 requests a day. Pro starts at $49 a month as of November 2026 (Microlink docs, pricing).

ScreenshotOne lets you set the viewport size and also the output size (image_width, image_height), so the resize happens on their side. You get 100 free screenshots a month, and the Basic plan is $17 a month for 2,000, as of November 2026 (options, pricing).

Where it breaks: your page now depends on another company's servers and quota. If the free allowance runs out, or a site blocks their crawler, the image in your grid fails. You don't keep a copy either, so the picture doesn't record what the site looked like on a given day. To compare more APIs, see the best website screenshot tools in 2026.

Method 3: Your own script with Puppeteer and sharp

To make many thumbnails and keep the files, a short Node.js script does the job. Puppeteer drives a headless Chrome and sharp resizes the image.

npm install puppeteer sharp

Save this as thumbs.cjs:

const puppeteer = require('puppeteer');
const sharp = require('sharp');

const urls = [
  'https://example.com',
  'https://developer.mozilla.org',
];

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setViewport({
    width: 1280,
    height: 800,
  });

  for (const [i, url] of urls.entries()) {
    await page.goto(url, {
      waitUntil: 'networkidle2',
      timeout: 60000,
    });
    const shot = await page.screenshot({ type: 'png' });
    await sharp(shot)
      .resize(640, 400, {
        fit: 'cover',
        position: 'top',
      })
      .jpeg({ quality: 80 })
      .toFile(`thumb-${i + 1}.jpg`);
    console.log('saved', url);
  }

  await browser.close();
})();

Run it with node thumbs.cjs. Without fullPage, Puppeteer captures only the 1280 Γ— 800 viewport. sharp then scales it to 640 Γ— 400 JPEGs. We ran this exact script before publishing, and both files came out at 640 Γ— 400.

Where it breaks: the script shows the page exactly as a first-time visitor sees it. Our test thumbnail of MDN had a large ad block across its lower half. On many European sites, a cookie banner covers part of the hero. Lazy-loaded images can appear blank, and sites with bot checks return a "verify you are human" page instead. Fixing each of these means more code: selectors to hide, scrolling to load images, retries. For larger batches, see bulk website screenshots.

Method 4: Capture the full page cleanly, then crop

Sometimes the thumbnail is only one use of the image. Later you may also want the full page as a record, as a before-and-after, or for a report. Then capture the whole page once and cut the thumbnail from it.

Site2PDF captures a page as PNG or JPG at desktop (1920 px), tablet (768 px) or phone (390 px) width. Cookie banners and common ad slots are removed by default. A single page needs no account. A free account can also run a short list of URLs in bulk mode, or a few pages of one site. Images come back as a ZIP with one file per page. Plan limits are on the pricing section.

To turn a full-length capture into a thumbnail, crop the top of it. With sharp, that is the same resize call as above with fit: 'cover' and position: 'top'. In an image editor, select the top 1920 Γ— 1200 area of a desktop capture and scale it to 640 Γ— 400.

Where it breaks: Site2PDF does not output a ready-sized thumbnail, so you always do the crop yourself. It also captures what a signed-out visitor sees, so it cannot produce thumbnails of pages behind a login.

Which one should you use?

  • One or two thumbnails, right now: Chrome Device Mode. It's free and takes a minute.
  • Thumbnails that update on your own site: a thumbnail URL service. Check the free quota against your traffic first.
  • A folder of thumbnails you control: the Puppeteer script. Budget time for banners and blocked sites.
  • A clean image you will reuse beyond the thumbnail: capture the full page with Site2PDF, then crop. The same files also work for SEO screenshots and client reports.

FAQ

What size should a website thumbnail be?

It depends on where it appears. For link previews, use at least 1,200 Γ— 630 pixels (about 1.91:1), as Meta recommends. For grids, render at 1280 Γ— 800 and scale to 640 Γ— 400, or to 320 Γ— 200 for dense lists.

Can I generate a website thumbnail without coding?

Yes. Use Chrome DevTools Device Mode for a single image. Thumbnail URL services need only an <img> tag, not a program. Site2PDF captures one page or a list of pages from a form in the browser.

Why does my thumbnail show a cookie banner?

Every new browser session is a first visit, so consent banners appear. Close the banner by hand before capturing, hide it with a CSS selector in your script, or use a tool that removes common banners for you.

Why is part of my thumbnail blank?

Lazy-loaded images only load when they scroll into view, and some sites fade content in. Wait for the network to go quiet (networkidle2 in Puppeteer), or scroll the page once before you capture.

Do thumbnail services keep a copy of the page?

Not one that you own. The URL renders the page on their side when the image is requested. If you need to show what a site looked like on a given date, save the file yourself.

The takeaway

To generate a website thumbnail, you render a fixed-size window and then shrink it. Device Mode does this by hand, URL services do it live on your site, and a 30-line script does it in bulk. If you also want a clean full-page copy of each site, capture the pages with Site2PDF and crop the top.

Sources

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.