Figma SVG export too large? Make it smaller and cleaner

Why Figma SVG exports get big, from ids and clip paths to embedded images and outlined text, what to fix in the design, and what SVGO cleans up for you.

By UIXport team9 min read
On this page

Key takeaways

  • The extra weight in a Figma SVG usually comes from embedded image fills. Effects written as SVG filters, masks, clip paths and outlined text add more markup on top.
  • Fix the design first. Flatten finished artwork, switch off Clip content when nothing overflows, keep strokes simple and leave UI shadows to CSS.
  • SVGO's default preset removes unused ids, hidden elements, default values and extra decimals, but it leaves embedded images, filters and clip paths in place.
  • In UIXport, Clean SVG Markup (Remove Figma properties) is on by default. It runs SVGO's default preset in multipass mode, keeps the viewBox and rounds numbers to 3 decimals.
  • Keep the raw export when your code needs layer names as ids. For per-option SVGO settings or currentColor icons, the SVG Export plugin is the better fit.

Short answer: A Figma SVG gets large when an image fill is embedded in it as base64 text, when drop shadows and layer blurs become SVG filters, when masks and Clip content add mask and clip elements, and when text is outlined into paths. Fix those in the design first, then run the file through SVGO, which strips unused ids, hidden elements, default values and extra decimals. With its default settings SVGO will not remove an embedded photo, so export bitmaps as their own files.

You hand an illustration to a developer, and they ask why a "vector" is bigger than the photos on the page. Or they open an icon and find nested groups, a clip path the size of the whole icon and, if Include "id" attribute was checked, ids named after your layers. Neither is a Figma bug. The export writes down what the design contains, and some of that has no place in production code.

This guide assumes SVG is the right format and the file is just too heavy. If you are still choosing, start with SVG vs PNG for icons and logos.

Why are Figma SVG exports so large?#

Because the export describes every part of the design, including things the browser does not need. A handful of Figma features account for most of the weight.

SVG is an XML-based vector format, a text file of shapes and drawing instructions. Some Figma features translate into it verbosely, and a few of them are export checkboxes, which Figma export settings explained goes through one by one.

What you find in the file Where it comes from in Figma Removed by SVGO's default preset?
id attributes such as id="icon/search" The Include "id" attribute setting, off by default, which bases each id on the layer name (Figma Help) Unused ones yes, used ones are shortened
A <clipPath> the size of the frame A frame with Clip content on (Figma forum) No
<filter> blocks full of fe elements Drop shadows (Figma forum) and layer blurs. Background blur does not export to SVG (Figma Help) No
<mask> elements Masks, and inside or outside strokes exported with Simplify stroke off, which Figma replaces with a thicker, masked stroke (Figma Help) No
A long data:image/png;base64,... string An image fill (Figma forum) No
Long paths where your text was Outline text, which turns text into glyph shapes Shortened, not removed
Numbers like 14.642136, extra groups, default attributes How any editor writes SVG Yes

How do you make an SVG smaller in Figma itself?#

Simplify the layers before you export. An optimizer can tidy code, but it cannot tell that a shape is buried under another one or that a shadow could be CSS.

  • Flatten finished artwork. Flatten (Option Shift F on Mac, Alt Shift F on Windows) merges layers into one vector layer, which Figma says reduces file size and improves asset compatibility (Figma Help). It also bakes boolean groups into a single shape. It is destructive, so flatten a copy, not your only source component.
  • Check Clip content on icon frames. If nothing pokes outside the frame, switch it off, export again and check that the file still has the frame's size and viewBox. If a stroke really overflows, keep the clip.
  • Keep strokes simple. SVG only has centre strokes. For inside or outside strokes, leave Simplify stroke on, or outline the stroke before export.
  • Delete what nobody sees. Helper shapes, shapes covered by other shapes, leftovers at 0% opacity. SVGO removes zero-opacity elements, but nothing in its default preset checks whether one shape hides another.
  • Leave UI shadows to CSS. A card shadow written as an SVG filter is a block of markup that box-shadow or filter: drop-shadow() replaces with one line. Keep effects in the SVG only when they are part of the artwork.

For a wider tidy of hidden layers, duplicates and stray images across the file, UIXport's Asset finder lists them in one scan.

Why are embedded images the biggest culprit?#

An image fill does not become a link to a picture. It goes into the SVG as base64 text, and base64 is typically about a third larger than the binary it encodes (MDN).

So an illustration with a photo or texture inside is a raster image in a text wrapper. It gets none of the vector benefits, and SVGO's default preset leaves it alone: the removeRasterImages plugin exists but is not part of preset-default (SVGO).

Split the asset instead:

  1. Export the photo or texture as a raster file, such as WebP, AVIF or PNG.
  2. Export the vector parts as SVG, without the image fill.
  3. Layer them in HTML or CSS, so each part is compressed and cached the right way.

Not sure whether an illustration hides a bitmap? Select it, open UIXport's Asset finder and scan with the Selection scope and the Images type, which lists the layers with a visible image fill, with identical copies grouped into one card. An Original row in its Export as card then saves the stored image file itself, without a frame around it.

What does SVGO remove from a Figma SVG?#

SVGO removes editor leftovers and rewrites numbers and paths in shorter form, designed not to change how the file renders. It leaves the filters and clip paths a drawing uses, and it does not swap the colours you chose.

SVGO is an open-source Node.js library and command-line tool for optimizing SVG files. Its README notes that files from vector editors "usually contain a lot of redundant information" (SVGO on GitHub). Its default plugin set, preset-default, runs when you configure nothing, and these plugins do most of the work on a Figma file (SVGO docs):

Plugin What it does to a Figma export
cleanupIds Removes ids nothing references, such as layer-name ids, and shortens the ones in use (docs)
removeHiddenElems Removes elements with opacity: 0, display: none or zero size (docs)
cleanupNumericValues, convertPathData Round numbers and rewrite path commands more compactly. convertPathData keeps 3 decimals by default (docs, docs)
convertShapeToPath, mergePaths Turn basic shapes into paths and merge several paths into one (docs, docs)
collapseGroups, removeUnknownsAndDefaults Remove groups that do nothing and attributes set to their default value (docs, docs)

What stays matters as much. The viewBox and the width and height attributes are kept, because removeDimensions is not in the preset and removeViewBox left it in SVGO 4 (SVGO migration guide). If your toolchain still runs SVGO 3, disable removeViewBox in its config, or it strips the viewBox.

Steps to clean Figma SVGs in one export with UIXport#

UIXport runs SVGO inside Figma as part of the export, so there is nothing to install. We built its SVG export with cleanup on by default.

  1. Select the layers. Select your icons or illustrations on the canvas and open UIXport. It starts on the Exporter tab, with each selected layer listed and checked.
  2. Set the row to SVG. In the Export as card, change the format to SVG. Leave the scale alone: UIXport always exports SVG at 1x.
  3. Check the cleanup. Open Advanced settings. Clean SVG Markup (Remove Figma properties) is on by default. It runs SVGO's preset-default in multipass mode, keeps the viewBox and rounds numbers to 3 decimals.
  4. Export. Click Export Selected (N Formats). One file downloads directly, and two or more arrive in UIXport Export.zip.

When should you keep the raw SVG?#

Keep Figma's raw output when your code depends on what cleanup removes, mainly layer names as ids, or when your build already runs its own optimizer. In Figma's own export you get those ids only if you check Include "id" attribute.

  • Animation and scripting. If a developer animates #wheel-left or styles parts of an illustration by id, they need those ids. Cleaning removes every id nothing in the file references, and layer-name ids count as unreferenced.
  • Your own SVGO config. If your team runs SVGO in its build, it may want one config for every SVG, with extra plugins such as prefixIds. Raw files keep that config in charge.

In UIXport, switch off Clean SVG Markup (Remove Figma properties) in the Exporter. UIXport asks Figma for layer ids, so the raw file carries your layer names as id attributes. The Asset finder always cleans.

Need live, selectable text in the SVG? Use Figma's own export with Outline text unchecked, since UIXport always outlines text. The file then depends on the font being available wherever it is shown.

How do you check a cleaned SVG in code?#

Open the file in a text editor, search for a few tags, then render it in a browser next to the Figma frame.

Search for What it means What to do
data:image A bitmap is embedded Split it out as a separate image
<filter A shadow or blur Keep it for artwork, use CSS for UI effects
<mask or clipPath A mask, a complex stroke or Clip content Flatten, simplify the stroke or switch off Clip content
<text Live text Make sure the font loads, or outline it
id=" with your layer names The file was not cleaned Run it through SVGO, or keep it on purpose

Then compare the raw and cleaned sizes. If cleaning barely changed anything, the weight is most likely an image, a filter or outlined text, and the fix is in the design. View the SVG at 100% and zoomed in, test Safari when it has filters, and make sure the root <svg> has a viewBox so it resizes with CSS.

To run SVGO yourself with its defaults, install it with npm, then run svgo icon.svg -o icon.min.svg for one file or svgo -rf icons -o icons-min for a folder (SVGO on GitHub). UIXport's SVG export runs the same default preset inside Figma, in multipass mode.

What are the limits and gotchas?#

Most surprises after optimizing come from ids, filters and colours.

  • Id clashes when you inline several SVGs. cleanupIds shortens ids, so two cleaned icons can both use id="a" for their clip paths. SVGO's docs warn about conflicts when optimized SVGs share one document and suggest prefixIds (SVGO). Switching off Clip content on icon frames often removes the only id an icon needs.
  • Do not hand-delete Figma's filter scaffolding. Elements such as BackgroundImageFix look like junk, but a Figma staff member explains they work around differences between SVG renderers, and that drop shadows did not draw in Safari without them (Figma forum).
  • Colours stay fixed. Neither SVGO's default preset nor UIXport's cleanup swaps fills for currentColor. As of October 2026, the SVG Export plugin's Community listing includes a currentColor option and presets for different kinds of assets (Figma Community).

Clean SVG export is on UIXport's Free plan. To try it on your own icons, get UIXport from Figma Community.

Questions

Why is my Figma SVG export so large?

Usually because an image fill is embedded as base64 text, or because effects, masks, clip paths and outlined text add their own elements. Long decimals, extra groups and, when Include "id" attribute is checked, layer-name ids add more, and an optimizer such as SVGO removes most of those.

Does SVGO remove embedded images from an SVG?

Not with its default preset. The removeRasterImages plugin is not part of preset-default, so a base64 image stays in the file untouched. Export the bitmap as its own file instead.

Should I remove the viewBox from a Figma SVG?

No, keep it. The viewBox is what lets the drawing resize when you set a different width or height in CSS. Since SVGO 4 the default preset no longer removes it, and UIXport keeps it.

Will cleaning an SVG remove my layer names?

Yes, for ids that nothing in the file references. SVGO's cleanupIds plugin removes those and shortens the ones a clip path or filter still needs. If your code targets layers by id, keep the raw export.

Can I export a Figma SVG at 2x?

No. Figma exports SVG at 1x only, and UIXport ignores the scale on SVG rows. For vectors it does not matter, because the browser draws them at whatever size you set.

Can UIXport turn icon colours into currentColor?

No. Cleaning keeps the colours Figma wrote into the file. The SVG Export plugin lists a currentColor option, or you can replace the fills in your build.

Features in this post

Share this post

Share on XShare on LinkedIn

UIXport team

We build UIXport, the Figma plugin for exporting, compressing and delivering UI assets, at Sigma Studio.

About UIXport

Try it in Figma

Install the plugin from Figma Community. Free includes unlimited core exports and 10 Pro runs a month; Pro adds motion export, print-ready PDFs, AVIF and more.