Skip to main content
WizTools123
Free Online Tools

Tool Categories


Developer Tools New Tool

Free Online HTML to PNG Screenshot Generator

Paste HTML and CSS and get a PNG rendered in your own browser, or give it a URL and the page and its assets are fetched for you. Set a viewport width with phone, tablet and desktop presets, choose one times or two times pixel ratio, pick a background or make it transparent.

Free Forever Nothing Uploaded PNG at 1x or 2x Modern colours handled
Free Online HTML to PNG Screenshot Generator
Share this tool
Advertisement Slot (Top Banner) Google AdSense Unit • Responsive Banner
HTML Screenshot Generator Everything happens in this tab. Nothing you paste is sent anywhere.
What will be captured
The rendered screenshot
Nothing captured yet. Press Capture the PNG and the report of what had to be changed will appear here.
Report
If you give this page a URL, that address is sent to this site’s own server, which fetches the page, its stylesheets and its images and hands them back. This is the one exception on WizTools123: every other tool here works entirely inside your browser. It exists because a browser is not permitted to read another site’s HTML at all, so fetching a page any other way is impossible. No cookies are sent, so a page behind a login cannot be captured. Pasting your own HTML and CSS, which is the default below, contacts no server at all and never has.
Source
Viewport px px
Image #ffffff ms

Buy Us A Coffee

Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.

Buy Us A Coffee
Sponsored Content (Below Tool) Google AdSense Placement

The Four Things That Break a Browser Render

Learned the hard way while building the PDF version of this.

Modern colour functions stop the whole capture. html2canvas 1.4.1 parses colours itself and only understands the older syntaxes. A single oklch(), oklab(), color-mix() or color() anywhere in the tree, including in a stylesheet you did not write, makes it throw unsupported color function and abandon everything. Since these are now common in frameworks and in default stylesheets, this page walks the computed styles before capturing and rewrites every such declaration into a plain rgb(). It tells you how many it changed.

Resolving a colour needs a canvas, not a property read. The obvious approach, setting fillStyle to the value and reading it back, returns the same string you put in for anything the canvas does not recognise, so it tells you nothing. What does work is applying the value to a throwaway element, letting the browser compute it, then painting one pixel and reading it with getImageData from a one by one canvas. That comes back as real numbers because the browser has done the conversion in the only place it cannot fake it.

A color-mix() built from a var() cannot be resolved in advance. The variable’s value depends on where in the tree the declaration lands, and the mix has to happen after that. There is no honest way to pre-compute it, so the whole declaration is dropped rather than guessed at, and the count of dropped declarations is reported. Those elements render with whatever they inherit instead.

srcset has to be removed, not just ignored. Every image must become a data: URL before capture, or the canvas is tainted and cannot be exported at all. But if a srcset attribute survives, the browser is free to pick a candidate from it rather than the src that was inlined, and that candidate is a remote URL, and the canvas is tainted again. So srcset and sizes are stripped entirely from every image before anything is drawn.

How to Turn HTML into a PNG

A few steps, and nothing is uploaded.

1
Paste your markup, or give it a URL Pasting HTML and CSS is the default and sends nothing anywhere. A URL is fetched by this site’s server, which is stated in the panel.
2
Set the viewport Pick a preset or type a width. Full page height grows to fit the content; turn it off and set a fixed height to crop instead.
3
Choose the image settings One times for a plain screenshot, two times for a sharp one at double the pixels. Set a background colour, or make it transparent, and a wait if webfonts or layout need a moment.
4
Capture and save Press Capture the PNG. The log says what had to be changed for html2canvas to cope, then Save the PNG writes the file.

What to Know About Browser Rendering

Including what will not look the same as it does live.

This is a best-effort render, not a real browser screenshot. html2canvas reads the laid-out DOM and redraws it onto a canvas with its own painting code, so anything it does not implement comes out differently or not at all. Web fonts that have not finished loading fall back, lazy images that have not entered the viewport stay blank, anything drawn by JavaScript after load is not there, iframes and embedded video render as empty boxes, and complex filters, blend modes and some transforms are approximated. For a pixel-exact capture you need a real headless browser.
Modern colour functions are rewritten before capture, and some are dropped. html2canvas 1.4.1 abandons the entire capture on one oklch(), oklab(), color-mix() or color(), so every such declaration is resolved to rgb() first. A color-mix() containing a var() cannot be resolved ahead of time and is dropped instead, which means that element falls back to an inherited colour. Both counts are reported after every capture so you know what changed.
Giving this page a URL sends that URL to our server. A browser is not allowed to read another site’s HTML, so a fetcher on our side is the only way, and it is one of only three exceptions on WizTools123. Cookies are never sent, so a page behind a login comes back as a sign-in form. Pasting your own HTML and CSS is the default mode and contacts no server at all.
Every image has to be inlined, and a stray srcset will ruin it. Images are converted to data: URLs before the capture, because a canvas that has drawn a remote image is tainted and refuses to export. srcset and sizes are stripped for the same reason: left in place, the browser may pick a candidate that was never inlined. An image that could not be fetched is drawn as an empty box rather than failing the whole capture.

Key Features & Capabilities

What this tool does, and what it deliberately does not.

PNG at 1x or 2x Double the pixel ratio for a sharp image at the same layout.
Viewport control Phone, tablet and desktop presets, or any width you type.
Modern colours handled oklch and friends are resolved so the capture does not abandon.
Or fetch a live page The page, its stylesheets and its images, through one endpoint.
A no-server default Pasted HTML and CSS is rendered entirely inside your browser.
A report of what changed How many declarations were rewritten, dropped or left alone.

About the HTML Screenshot Generator

Turning HTML into an image is the sort of thing that should be easy and is not. The proper answer is a headless browser, which means installing one, keeping it updated and giving it somewhere to run. For a one-off image of a card, an invoice or a chart, that is a great deal of machinery. html2canvas takes a different route: it reads the page that your own browser has already laid out and redraws it onto a canvas. The layout is therefore genuinely correct, because a real browser did it, and only the painting is an approximation.

This page gives that library a controlled box to work in. Your markup goes into an element of a fixed width, your CSS is applied to it, and that element is what gets captured, so the viewport width is a real constraint rather than a hint. The URL mode reuses the same endpoint the other two server-touching tools on this site use, fetching the page, its same-site stylesheets and its images, and inlining all of them before anything is drawn.

Most of the work here is not the capture but the preparation, and all of it came from building the PDF version of this tool first. One modern colour function anywhere aborts the whole render, so the computed styles have to be walked and rewritten. Resolving a colour reliably means painting a pixel and reading it back, because reading the property gives you your own string. A mix built from a variable cannot be resolved at all and has to be dropped honestly rather than guessed. And every image has to be inlined with its srcset stripped, or the canvas is tainted and the export silently fails. The log after each capture exists because those fixes change your page, and you should be told what changed.

Frequently Asked Questions

Fonts, modern colours, tainted canvases and full-page captures.

Because html2canvas repaints the page with its own code rather than taking a real screenshot. Web fonts that had not loaded fall back to a system font, lazy images outside the viewport stay blank, anything a script draws after load is missing, iframes and video come out as empty boxes, and some filters and blend modes are approximated. Raising the wait before capture helps with fonts and late layout, but it cannot make the library implement a feature it does not have.

html2canvas 1.4.1 parses colour values itself and only knows the older syntaxes. A single oklch(), oklab(), color-mix() or color() anywhere in the tree makes it throw that error and abandon the entire capture. This page walks the computed styles first and rewrites every such declaration into plain rgb(), so the capture goes ahead. The log tells you how many were rewritten.

A color-mix() whose arguments come from a var() cannot be worked out ahead of time, because the variable resolves differently depending on where in the tree the rule applies and the mix happens after that. Guessing a value would quietly change your design, so the whole declaration is removed and the element uses what it inherits. The count of dropped declarations is reported after every capture.

A canvas that has drawn an image from another origin becomes tainted, and a tainted canvas refuses to produce a PNG at all. Inlining each image as a data: URL keeps everything same-origin. The srcset and sizes attributes have to be stripped as well, because otherwise the browser may pick a candidate from the srcset that was never inlined, and the canvas is tainted again by the back door.

No. The fetcher never sends cookies, so the request arrives as an anonymous visitor and you get the sign-in page. For anything behind a login, open it yourself, copy the markup you want and use the paste mode, which runs entirely in your browser and sends nothing anywhere.

Every Other Developer Tool

88 more tools in this set. All free, all in your browser.

Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner