How to Capture an HTML Document as an Image in Chrome
In this article
You can capture an entire HTML document as an image directly in Chrome using the built-in Developer Tools. This method works for any web page or local HTML file, and it saves the full page—not just the visible viewport—as a PNG image. No extra software or extensions are required. The process takes about a minute once you know the steps.
What You'll Need
- Google Chrome (any recent version, desktop)
- The HTML document you want to capture (either a live URL or a local file)
Step-by-Step
- Open the HTML document in Chrome. If it’s a local file, press Ctrl+O (Windows/Linux) or Cmd+O (Mac) and select the file. If it’s a web page, just navigate to the URL.
- Open Developer Tools. Right-click anywhere on the page and select Inspect, or press Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (Mac). The DevTools panel will open, usually on the right or bottom of the window.
- Open the command menu. With DevTools focused, press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac). This opens the “Run command” box.
- Type the capture command. In the command menu, type
screenshot. You’ll see two options: Capture full size screenshot and Capture screenshot. Choose Capture full size screenshot by clicking it or pressing Enter when it’s highlighted. - Save the image. Chrome will automatically download a PNG file to your default Downloads folder. The filename will look like
filename.png(e.g.,page.png). You can rename it or move it after.
That’s it. The captured image includes the entire page, even parts below the fold. The image dimensions match the full height of the document.
Common Mistakes
- Using the wrong command: If you choose “Capture screenshot” instead of “Capture full size screenshot,” you’ll only get the visible viewport, not the full document.
- Not opening the command menu correctly: The shortcut Ctrl+Shift+P must be pressed while DevTools is focused. If you press it while the page is focused, you might open a private browsing window or a print dialog instead.
- DevTools not docked as expected: The command menu works regardless of where DevTools is docked, but if you can’t see the DevTools panel, you might be on a small screen. Just press the shortcut again.
- Local file with external resources: If your HTML references local images or CSS files, make sure they are in the same folder or use relative paths. Otherwise, those elements may appear blank in the screenshot.
Tips
- Use a device toolbar for mobile view: If you want to capture the page as it appears on a phone, click the device toolbar icon (the rectangle with a phone) in DevTools, select a device, then run the full-size screenshot. The image will match that viewport width.
- Capture only a specific element: Right-click an element, choose “Inspect,” then in the Elements panel right-click the highlighted line and select “Capture node screenshot.” This captures just that element (e.g., a single div or table).
- Set a custom viewport width: In the device toolbar, you can type a custom width (e.g., 1200px) to control the width of the captured image.
- Disable lazy loading: If your page uses lazy loading for images, scroll to the bottom before capturing so all images have loaded. Otherwise, some images may be missing in the screenshot.
Troubleshooting
- The command menu doesn’t appear: Make sure DevTools is open and focused. Click anywhere inside the DevTools panel first, then press the shortcut again.
- The screenshot is blank or black: This can happen if the page uses canvas or WebGL content that doesn’t render in the screenshot. Try scrolling to the area with the canvas element and capture again, or use a different method for canvas-heavy pages.
- The image is cut off on the right side: This usually means the page has horizontal overflow (content wider than the viewport). Try setting a wider viewport in the device toolbar before capturing, or fix the CSS overflow issue.
- No file is saved: Check your Downloads folder. Chrome might have blocked the download if you’re in a corporate environment. You can also try pressing Ctrl+J (Windows) or Cmd+Shift+J (Mac) to see recent downloads.
- The screenshot is too large: For very long pages, the PNG file can be huge. You can split the capture into multiple screenshots or use an image compression tool after saving.
Frequently Asked Questions
Can I capture an HTML document as a JPEG instead of PNG?
Chrome’s built-in tool only saves as PNG. If you need JPEG, you can convert the PNG using any image editor or online converter.
Does this work on mobile Chrome?
No, the Developer Tools method is only available on desktop Chrome. On mobile, you would need a third-party app or a web service that takes full-page screenshots.
Can I capture a page that requires login?
Yes, as long as you are logged in in the same Chrome profile. The screenshot captures what is rendered in the browser, including authenticated content.
Will the screenshot include pop-ups or tooltips?
No, the screenshot captures the static page. Any transient elements like hover menus or pop-ups that appear on mouseover will not be included unless they are open at the moment of capture.
Can I capture a very long page (e.g., 50,000 pixels tall)?
Yes, Chrome can capture pages of virtually any length, but the resulting PNG file may be extremely large in terms of pixels and file size. It might take a few seconds to process, and the file could be tens of megabytes.
Is there a way to capture without DevTools?
You can use the browser’s print-to-PDF feature and then convert the PDF to an image, but that changes the layout. DevTools is the most direct method.