Convert SVG to AVIF

Converting SVG to AVIF renders the drawing to pixels and encodes it with the AV1 still-image codec, transparency included. It works, and for most web assets it is the wrong move: a 140-byte test drawing came out as a 9,730-byte AVIF, and the vector was already sharp at every size.

  • Where it runs In your browser. The file is never uploaded.
  • Rebuilt AVIF works differently from an SVG, so this is not the gradual degradation a lossy codec applies. What AVIF 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.

For most web assets, the right answer is to ship the SVG

AVIF is the most efficient still-image format in general use and it is worth the migration for photographs, screenshots and product shots. None of that reasoning transfers to a drawing. An SVG is a description of shapes, so it is already about as small as the picture can be expressed, and it renders at whatever size the layout gives it without a second file.

The measurement: a 140-byte test drawing rendered at the default 1,024 pixels came out as a 9,730-byte AVIF. Real logos are larger as SVGs — a few kilobytes is typical — but the conclusion holds at that scale too, and the AVIF is the one that also needs a srcset and a fallback. If the reason for this conversion was byte count, it is working against you.

The cases where rendering to AVIF is genuinely right

There are four, and they are worth knowing because they are not obvious. The first is an SVG that is not really a vector: a file produced by tracing a photograph, or one with a base64 raster embedded inside it, both of which can run to hundreds of kilobytes and will encode far smaller as AVIF. The second is a drawing that leans on filters — Gaussian blurs, blend modes, complex clipping — which browsers implement with real differences, so rasterising once makes the result identical everywhere.

The third is a pipeline constraint: a CDN transform, an image proxy or a CMS that handles raster formats and refuses SVG. The fourth is trust — an SVG is XML that can carry script and external references, so a site accepting drawings from users often rasterises them rather than maintaining a sanitiser. Any of those makes this conversion correct. "Everything else is AVIF now" does not.

One file for every density, traded for one fixed size

The property being given up is easy to underrate. A single SVG serves a phone at 3× density, a laptop at 2×, an external monitor at 1× and a print stylesheet, all from the same bytes, and it is sharp on every one. The moment it becomes an AVIF it serves exactly one of those well.

Recovering the rest means rendering at several widths and writing a srcset, which is three or four files and a chunk of markup where there was one file and none. That complexity is the real cost of this conversion, and it is larger than the kilobytes on either side of the comparison.

Choosing the render width, and doubling it for high density

The scale setting is the only decision the conversion asks you for. The default renders 1,024 pixels wide and the height follows the drawing’s own proportions; the range is 0.1 to 10, giving 102 to 10,240 pixels.

The habit worth having is to find the largest CSS width the image will ever occupy and render at twice it, which covers 2× displays without going to a full srcset. A logo shown at 180 pixels wants a 360-pixel render, not a 1,024-pixel one — and at those dimensions the AVIF is genuinely small, which does not change the fact that the SVG was smaller and served every density at once.

What lossy compression does to a hard edge

AVIF is the intra-frame path of a video codec, built to predict blocks from their neighbours and discard the residual detail a moving eye will not catch. On a photograph that residual is texture. On a drawing it is the edge of a letterform, and the default quality of 82 is set for the former.

The visible result is a slight softening along crisp boundaries and, at lower settings, a faint mottling in large flat fills where the encoder has decided the difference does not matter. Push the quality towards 95 for flat artwork. At these dimensions it costs single-digit kilobytes and it is the difference between a mark that looks drawn and one that looks photographed.

Transparency survives, and it costs a plane of its own

The alpha channel comes through: on a test drawing the corner pixel of the resulting AVIF reads 0,0,0,0, so a cut-out mark drops onto any background exactly as the SVG did. That is not universal among raster targets — the GIF path on this site turns the same corner opaque black.

It is stored as a second coded plane alongside the colour, effectively a small second image inside the container. On a photograph that overhead disappears into the noise; on a simple drawing where the whole file is a few kilobytes it is a visible share of the total, and part of why the numbers above are what they are.

AVIF support is two decades younger than SVG support

Every current major browser decodes AVIF and has for several years, which is enough for most sites to serve it directly. SVG has been read by everything since well before that, and by a great deal that is not a browser: design tools, office software, ticketing systems, email clients that would show a broken image for an AVIF.

So replacing a vector with an AVIF narrows the set of things that can display the asset, and the usual mitigation — a picture element with a fallback source — means shipping two files where the SVG alone would have worked in both places. That is a real cost with no matching benefit.

The encoder is slow and it is running on your own processor

The AV1 encoder is the largest WebAssembly module this site ships and the slowest to run, because making a still AVIF means performing an AV1 intra-frame search. A single 1,024-pixel drawing took about a second end to end in testing, including fetching the encoder for the first time.

For one file that is nothing. For a folder of two hundred illustrations it is a genuine wait, and it repeats on every build if this sits in a pipeline. Worth weighing against the byte result rather than separately from it — spending build time to make a vector larger is a poor trade in both directions.

Rendering a set of illustrations in one pass

Drop the folder. Every drawing is rendered at the same scale and encoded with the same quality, and the results come back as a ZIP. A shared scale is what an illustration set usually wants, since consistency across the set reads better than any single file being individually optimal.

Their proportions will not match unless the source viewBoxes did — the scale fixes the width and the height follows each drawing — so check the dimensions before wiring them into a grid that assumes a common aspect ratio. And keep the SVGs: they are the master copies, and the AVIFs are an export that can be regenerated at any size.

How to render an SVG as an AVIF image

  1. Decide whether the SVG could be served as it is.
  2. If not, drop it here and set the scale to twice the displayed width.
  3. Raise the quality for flat artwork, then download the AVIF.

SVG against AVIF: a description that scales against a fixed grid

SVG compared with AVIF
SVGAVIF
Full nameScalable Vector GraphicsAV1 Image File Format
File extension.svg.avif
Media typeimage/svg+xmlimage/avif
CompressionUncompressedEither, depending on the setting
First published20012019
Published byW3CAlliance for Open Media
SpecificationSVG 1.1AV1 Image File Format
LicensingOpen standardOpen standard
Standing todayCurrentCurrent
Bit depth12
Colour it can describeRGBRGB, YCbCr, wide gamut
Largest image65,536 px per side
Opens in a browserEvery browserCurrent browsers
Considered insteadPNG, PDFWebP, JXL, JPG

What is lost

SVG describes shapes and AVIF 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.

What survives

Transparency survives. Both SVG and AVIF store an alpha channel, so a cut-out stays cut out and nothing is filled in behind it.

Animation survives. SVG and AVIF both hold multiple frames, so the result moves rather than freezing on the first one.

Opening the result

Current browsers read AVIF; older ones do not. It is the less portable of the two, so it is worth being sure the program at the other end accepts it before sending one.

AVIF is a container rather than a single format. What actually plays is the codec inside it — usually AV1 — which is why two files with the same extension can behave differently on the same device.

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

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.

AVIF comes from Alliance for Open Media and dates from 2019, specified as AV1 Image File Format. GIMP, Squoosh and ImageMagick all read it.

SVG was published in 2001 and AVIF in 2019. The older one is generally the safer file to hand to somebody; the newer one usually does the job in fewer bytes.

SVG to AVIF: file size, sharpness and when not to convert

Is an AVIF smaller than the SVG it came from?

Usually not, and often not close. A 140-byte test drawing rendered to a 1,024-pixel AVIF came to 9,730 bytes. The gap narrows on complex illustrations with thousands of paths and can reverse on a traced one, but for logos and icons the vector wins by an order of magnitude.

When is it worth rendering an SVG to AVIF?

When the SVG is not really a vector — a traced image or one with an embedded photograph — when the drawing uses filters that render differently across browsers, or when a pipeline or CDN cannot handle SVG at all. Those are real cases and they are the minority.

Does the transparency survive?

Yes. AVIF carries an alpha channel and it is preserved: on a test drawing the corner pixel of the result reads 0,0,0,0. The alpha is stored as a second coded plane, which is part of why the file is not smaller.

What size does the drawing get rendered at?

An SVG has no pixel size, so one is chosen. The default is 1,024 pixels wide with the height following the drawing’s proportions, and the scale setting runs from 0.1 to 10 — so 102 to 10,240 pixels.

Do browsers support AVIF as well as they support SVG?

Not as widely. Every current major browser reads AVIF, but SVG has been universally supported since the 2000s. Replacing a vector with a format that needs a fallback is a step backwards in reach as well as in bytes.

Is the drawing uploaded to be rendered?

No. resvg and the AV1 encoder both run as WebAssembly in this tab, so an unreleased asset never leaves your machine — and a slow conversion is your own processor, not a queue.

More about these formats

Where these figures come from

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