HTML to GIF Converter

Draw a saved HTML page as a single GIF picture, 1280 px wide.

or drop files here

HT

HTML Format

HyperText Markup Language

The standard markup language for web pages, maintained by the WHATWG as the HTML Living Standard. It describes the structure of a page with elements and attributes.

  • text-based markup
  • elements and attributes
  • styled with CSS
GI

GIF Format

Graphics Interchange Format

A raster image format developed by CompuServe. It uses LZW compression, a palette of at most 256 colors per frame, and supports simple animation.

  • 256-color palette per frame
  • lossless LZW compression
  • animation

How to convert HTML to GIF

Follow these steps to convert HTML to GIF online.

    1

    Choose your HTML file, or several at once.

    2

    Wait while the converter turns each file into GIF.

    3

    Download each new GIF file. Your original file isn't changed.

What to know before converting HTML to GIF

  • The page is laid out 1280 px wide and the picture is as tall as the page, up to 4096 px.
  • Scripts, linked stylesheets, frames and outside images are not loaded or run.
  • Images and fonts stored in the file as data: URLs are drawn.
  • The GIF is one still picture, so nothing animates.
  • A GIF frame holds at most 256 colors, so photos and gradients lose some detail.

About HTML files

What is an HTML file?

HTML is the markup language that describes web pages. Its early revisions were developed at CERN and then the IETF between 1990 and 1995, and the WHATWG now maintains it as a Living Standard. An HTML file is plain text made of elements and attributes: headings, paragraphs, links, tables. CSS supplies the look, and JavaScript can add behavior. The media type is text/html.

A saved page rarely stands alone. It usually points at images, fonts, stylesheets and scripts stored elsewhere, and that matters here. Turning HTML into a GIF means drawing the page once, so the picture can only show what the file itself contains.

You meet HTML files as saved web pages, exported reports, invoices, email designs and documentation. A GIF of one is useful when you need a picture of the layout, for a thumbnail, a bug report or a slide, and not the live page.

Programs that open HTML files

  • Windows, Mac and Linux: Firefox renders a local HTML file, and Mozilla documents Open File with Ctrl+O or Command+O.
  • Mac, Windows and Linux: Visual Studio Code edits HTML with syntax highlighting, completion and formatting. Its built-in language analysis looks only at the current file, so it won't show you what a linked stylesheet or script contains.
  • Web: any browser renders HTML.

A saved page often links to pictures and styles stored elsewhere, so opened offline it can lose its pictures or styling.

HTML and GIF compared

  • Extensions and media types: .html and text/html; .gif and image/gif.
  • What they hold: HTML is text that describes a document. A GIF is a grid of palette indexes, so headings, links and form fields become plain pixels, and the text can no longer be selected or searched.
  • Colors: a GIF frame tops out at 256 colors. A flat page with solid fills suits that, while photos and soft shadows lose detail.
  • Animation: GIF can hold frames, but this page writes one.
  • Links: the picture shows how a link looks and nothing more.
  • Linked files: an HTML document can link to separate resources rather than hold every asset itself. Only those stored in the file reach the GIF.

What this page does is specific. It parses your file without running anything, then removes what would run or load: scripts, the base element, link elements, meta http-equiv tags, frames, objects, event attributes, audio, video (except a poster image stored in the file) and SVG references that point outside the page. It lays the result out 1280 px wide, with an 800 px window for vh units, inside a sandbox that allows only inline styles and data: images and fonts. The picture is as tall as the page, up to 4096 px.

Other ways to convert HTML to GIF

All three methods below take a browser screenshot, which is a PNG, and then change it to GIF with ImageMagick.

  • Firefox (Windows, Mac, Linux): tick "Take a screenshot of the entire page" in the Developer Tools settings, or type :screenshot --fullpage --filename page.png in the Web Console. Then run magick page.png page.gif.
  • Chrome (Windows, Mac, Linux): with DevTools docked, open the Command Menu (Control+Shift+P, or Command+Shift+P on a Mac), type screenshot, choose Capture area screenshot and drag over the part you want. Convert the download with magick screenshot.png page.gif.
  • Playwright (Node.js script): call await page.screenshot({ path: 'capture.png', fullPage: true }); after opening the page, then magick capture.png capture.gif.

Problems with HTML files

  • Images are blank: they are linked, not embedded, and an offline HTML document can lose linked pictures or styling this way. Use data: URLs in the HTML, or one of the screenshot methods above.
  • The layout looks unstyled: the CSS lives in a linked file. Move it into a <style> block.
  • Text is in the wrong font: web fonts are linked. Embed them as data: URLs or accept a fallback font.
  • Garbled characters: a wrong or missing character encoding. Declare the encoding in the file.
  • The picture stops partway down: the page is taller than 4096 px. Split the HTML into sections.
  • Boxes that a script fills in are empty: dates, totals and counters that JavaScript writes never appear, because no script runs. Write the values into the HTML itself, or take a browser screenshot.
  • Nothing moves: a GIF made here is one frame. Use a screen recorder for motion.

Frequently Asked Questions

Everything you need to know about our converter

How do I convert HTML to GIF?

Is the GIF animated?

Why are the images on my page missing?

Why doesn't my stylesheet apply?

Does JavaScript run before the picture is taken?

How wide is the GIF?

Why is the bottom of my page cut off?

Do web fonts load?

Can I convert a web address instead of a file?

What happens to a video on the page?