Convert SVG to GIF

Converting SVG to GIF renders the drawing to pixels and reduces it to a palette of at most 256 colours, in a single still frame. Two things to know before you start: transparency does not survive, so the empty areas are filled with the background colour set on this page, and the default render is 1,024 pixels wide, which is much larger than most places asking for a GIF expect.

  • Where it runs In your browser. The file is never uploaded.
  • Rebuilt GIF works differently from an SVG, so this is not the gradual degradation a lossy codec applies. What GIF can express is reproduced faithfully; what it has no equivalent for does not survive at all.
  • File size limit Up to 100 MB per file, free, without an account.
  • Worth knowing Text is rendered with the fonts embedded in the file; anything else falls back.

Up to 100 files at once. Mixed formats are fine.

A cut-out drawing arrives on a solid card

This is the thing to settle before you convert anything, and almost nothing that offers this conversion mentions it. GIF does have transparency, but only in one form: a single entry in the colour table can be marked invisible. The encoder used here never marks one. It builds a palette, writes it as a list of red-green-blue triples, and by the time the file is assembled there is nowhere for the alpha information to live.

A drawing rendered from an SVG has transparent pixels wherever nothing was drawn, so every one of them has to become something opaque before the palette is built. They are filled with the background colour set on this page, which starts at white. A logo drawn on nothing therefore arrives as a logo on a white card — invisible against a white page and perfectly visible against a dark one, which is the case worth checking before you send it anywhere.

Set the fill colour before the palette is built

The background colour picker on this page decides what the empty areas become, and it is read before anything else happens: the fill is painted onto the canvas first and the rendered drawing is composited onto it in one pass. That ordering is why the edges come out clean. Filling afterwards, or scaling a transparent render and then filling it, leaves a fringe of half-transparent pixels along every curve that the fill then darkens.

Match the value to whatever the GIF will sit on. If the destination is a white page, leave it alone. If it is a coloured panel and you know the hex value, type it in and the join disappears. If the destination is likely to change — a template that is white this year and dark the next — put a rectangle covering the whole viewBox into the drawing instead, so the file carries its own backing and does not depend on a setting made once.

A 1,024-pixel render is far too large for a GIF

An SVG has no size, so the conversion picks one: 1,024 pixels wide by default, with the height following the drawing’s proportions. That default suits PNG and WebP, where a large flat image costs little. It suits GIF badly, because the places that still ask for one — signature blocks, avatars, forum icons — are almost always working at 100 to 300 pixels.

Use the scale setting. At 0.2 the same drawing renders 205 pixels wide, which is closer to what these destinations display, and the file shrinks roughly with the area. Sending a 1,024-pixel GIF where 150 was wanted means somebody else’s software scales it down, usually badly and always without asking.

What the palette actually did to a measured file

The reduction is less brutal than the number 256 suggests, at least on the kind of artwork that arrives as an SVG. Flat fills use one colour each, strokes use one more, and antialiasing adds a spread of intermediate shades along every edge — which on a two-colour drawing is a few dozen values in total.

On the test file the quantiser produced a palette small enough that the encoder wrote a colour table of sixteen entries, the smallest power of two that would hold it, and the whole 1024 by 1024 GIF came to 7,844 bytes from a 140-byte SVG. Flat artwork compresses extremely well in this format; GIF stores runs of identical indices, and a drawing is mostly runs.

Where a drawing does exceed 256 colours

Gradients are the case. A linear or radial fill across a large area generates hundreds of distinct values, and the palette cannot hold them, so the quantiser picks representatives and the result steps rather than blends. On a 1,024-pixel render those steps are wide enough to see clearly.

Soft drop shadows, blurred edges and semi-transparent overlays do the same thing, since each produces a range of blended values. If the drawing has any of these and the destination cannot be talked out of GIF, render smaller — fewer pixels means fewer distinct blends and less visible banding.

Animation in the SVG does not survive the render

SVG can animate. It has SMIL elements, it responds to CSS animation, and a file can carry script. GIF can animate too, which makes it tempting to assume the two connect. They do not: the renderer produces one static frame at the drawing’s initial state, and the encoder writes exactly one frame into the file.

So an animated logo comes out as its first pose, and no setting changes that. Producing a moving GIF from a moving SVG is a different job entirely — it needs the animation played and captured frame by frame, which is not what a still-image renderer does.

Why the destination is still asking for a GIF

GIF has been readable by everything since 1987, and that is the only property that matters to whoever wrote the requirement. Mail clients, forum engines, intranet portals and enterprise software written before the mid-2000s all read one, and the person specifying the format wanted an answer that could not fail on any of them.

Read the rest of that specification while you are there. A requirement old enough to name GIF usually also pins a maximum pixel size and a maximum byte count, and the format was rarely the only constraint. Getting all of them right in one attempt is faster than three rounds of rejection.

PNG gives the same picture and keeps the transparency

It is worth one attempt before accepting the compromise. A great many systems that say GIF in their help text accept PNG in their validation code, because the text was written earlier than the code and the code covers whatever the underlying library reads. If it goes through, the transparency survives exactly and the colour reduction never happens.

Where GIF is genuinely required, take it and choose the fill colour deliberately rather than accepting the default without looking. The result is then a flat-backed image that was decided rather than one that happened, and it will look the same to every recipient — which is what the requirement was trying to achieve in the first place.

Rendering a set of drawings for one template

Drop the folder. Each SVG is rendered at the same scale and encoded separately, with everything returned as a ZIP. The palette is built per image rather than across the set, so the same brand colour can land at a slightly different index in two files — invisible in use, and a reason not to expect the files to be byte-comparable.

Each file also keeps its own settings, so the background colour is chosen per row rather than once for the whole drop. For a set going into one template that means setting the same value on each of them, which is worth doing before you start rather than discovering it one signature at a time; the compensation is that a folder holding artwork for two different backgrounds does not have to be split into two passes.

How to render an SVG as a GIF

  1. Set the background colour to whatever the GIF will sit on.
  2. Drop the file onto this page and set the scale to the size you need.
  3. Download the single-frame GIF.

SVG against GIF: unlimited colour meeting a 256-entry palette

SVG compared with GIF
SVGGIF
Full nameScalable Vector GraphicsGraphics Interchange Format
File extension.svg.gif
Media typeimage/svg+xmlimage/gif
CompressionUncompressedLossless — nothing is discarded
First published20011987
Published byW3CCompuServe
SpecificationSVG 1.1GIF89a
LicensingOpen standardOpen standard
Standing todayCurrentLegacy, still read everywhere
Bit depth8
Colour it can describeRGBindexed palette
Largest image65,535 px per side
Opens in a browserEvery browserEvery browser
Considered insteadPNG, PDFWebP, MP4

What is lost

GIF has no alpha channel. A transparent SVG comes out with those areas filled in — white unless something else is set — and no setting in GIF brings the transparency back.

SVG describes shapes and GIF stores pixels. The result is sharp at the size it was rendered and no sharper — enlarging it afterwards can only invent the pixels in between, which is why the export size matters more here than in most conversions.

GIF holds a single still image. An animated SVG keeps its first frame and loses the rest, so a conversion is a way to take a still out of one, not a way to move it.

GIF stores at most 256 colours per frame. A photograph converted into one is reduced to a palette, which is what makes the sky look stepped rather than smooth — it is the format, not a quality setting.

Opening the result

The usual programs do not overlap: SVG opens in Inkscape, Adobe Illustrator and Figma, GIF in GIMP, Adobe Photoshop and ImageMagick — so whoever receives the result needs something from the second list.

File size and quality

GIF packs the same samples into roughly half the space. Nothing is discarded — decode it and you get the SVG back bit for bit — which makes it the better shelf for anything you intend to keep.

What each format is for

SVG is W3C's format, published in 2001. The specification is SVG 1.1, and it is worth reading if the file has to outlive the tool that wrote it.

GIF comes from CompuServe and dates from 1987, specified as GIF89a. GIMP, Adobe Photoshop and ImageMagick all read it.

SVG to GIF: filled backgrounds, palettes and movement

What happens to the transparent parts of the drawing?

They are filled with a solid colour, because the transparency is not carried across. GIF can nominate one palette entry as invisible and the encoder here does not, so every pixel in the file is opaque. The background colour picker on this page decides which colour they become, and it starts at white.

Can I choose the colour behind the artwork?

Yes. Set the background colour picker before converting and the transparent areas are filled with that value. If you would rather the file carried its own backing wherever it goes, add a filled rectangle covering the whole viewBox behind your artwork in Inkscape, Illustrator or a text editor and export again.

Does an animated SVG become an animated GIF?

No. The renderer draws one static frame, and the encoder writes one frame into the file. SMIL animation, CSS animation and anything driven by script are all resolved to their initial state.

How large is the GIF?

The drawing is rendered 1,024 pixels wide by default and the height follows its proportions. On a test file that produced a 1024 by 1024 GIF of 7,844 bytes from a 140-byte SVG. Use the scale setting to render smaller; 1,024 pixels is far larger than most GIF destinations want.

Will the 256-colour limit spoil the drawing?

Only if it has gradients. Flat fills and strokes quantise cleanly — the measured file needed a palette of sixteen entries. A drawing with a smooth gradient or a soft shadow will show visible stepping.

Where does the rendering happen?

In this browser tab. resvg draws the SVG and a small encoder builds the GIF, both as WebAssembly on your machine, so the drawing is never uploaded.

More about these formats

Where these figures come from

The claims this page makes about SVG and GIF are checkable, and these are the documents that settle them.