Free browser tool · Runs locally

HTML to image converter

Paste HTML and CSS, or open an .html file, and download it as a PNG, JPG or WebP at the size you choose, from an Instagram post to a link preview. Your browser draws it, so your code isn't uploaded anywhere: it only fetches the fonts and pictures your HTML links to.

px
Drawing…
Scripts don't run — drop an .html file onto the editor or edit live.

01 · How it works

Three steps.

No account needed, and your files stay in your browser.

  1. 01

    Paste your HTML or open a file

    A whole page or a fragment with its <style> both work. Google Fonts, stylesheets and pictures linked from other sites are fetched and drawn in, when those sites allow it.

  2. 02

    Pick the size, scale and format

    Choose a post size such as 1080 × 1350 for Instagram or 1200 × 627 for a LinkedIn link, or type your own. 2× doubles the pixels for sharper text.

  3. 03

    Download the image

    Save it as a PNG, with a clear background if you like, or as a JPG or WebP. The preview is drawn the same way as the file.

HTML is how Margin designs

Have your assistant write the HTML for you.

In Margin every design is HTML and CSS on a shared canvas. Connect Claude or ChatGPT once: your assistant lays out posts, carousels and covers at each network's size, your team changes any word, and Margin exports them as PNG or PDF and schedules them.

02 · FAQ

Common questions.

Quick answers on scripts, fonts, pictures and privacy.

Does JavaScript in my HTML run?
No. The image shows your HTML and CSS as the browser lays them out, without running scripts. A page that builds its content with JavaScript, or styles it with the Tailwind CDN script, needs its finished HTML and a compiled stylesheet instead.
Do Google Fonts and other web fonts work?
Yes. Fonts linked from Google Fonts, and any @font-face whose files can be loaded from other sites, are fetched and written into the image. Fonts installed on your computer work too.
Why is a picture missing from my image?
Either its site doesn't let other pages load it, or its address is relative, like logo.png, so there's nowhere to fetch it from. The tool lists those addresses. Use a full https address from a site that allows it, or a data: URL.
Is my HTML uploaded to Margin?
No. Your browser reads and draws it on your device. The only requests it makes are for the fonts, stylesheets and pictures your HTML links to, sent straight to the sites that host them.
What size should a social media image be?
1080 × 1350 for an Instagram portrait post, 1080 × 1920 for Stories, Reels and TikTok, 1200 × 627 for a LinkedIn link image and 1600 × 900 for X. Our social media size guide lists every network's sizes, each from the network's own docs.
Will the image look like my HTML does in the browser?
It's drawn by your own browser's engine, so it matches what that browser shows in a window of the same size. In our tests against Chrome screenshots of the same HTML (27 Nov 2026), the pixels matched except where a script would have changed the page.

More free tools

All tools

Sources · checked 27 Nov 2026