(Created on )

Puppeteer: Expected 'quality' ({value}) to be between 0 and 100, inclusive.

Screenshot quality is outside the allowed 0–100 range.


Screenshot quality is outside the allowed 0–100 range.

Error message

Expected 'quality' ({value}) to be between 0 and 100, inclusive.

{value} is replaced by the value shown in your error message.

How this error happens

quality is a percentage, not an unlimited compression setting. A value above 100 or below 0 is rejected before the screenshot is taken.

The snippets use an open Puppeteer page named page.

await page.screenshot({
    type: "jpeg",
    quality: 120,
});

How to fix

Use a value from 0 to 100 for JPEG or WebP output.

await page.screenshot({
    type: "jpeg",
    quality: 80,
});

Things to keep in mind

PNG does not accept quality. Omit it when you need PNG output.

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →