Skip to content
GigAI Tools

SVG Minifier, Compress & Minify SVG Online

Paste an SVG and get the smallest byte-for-byte equivalent back instantly, comments, metadata and whitespace gone, coordinates rounded, markup collapsed to one line. Pick a Safe, Balanced or Aggressive preset, watch the size bar drop, and copy. Nothing is uploaded.

100% browser processingFree · no sign-up

What is the svg minifier?

The SVG Minifier aggressively shrinks SVG markup by collapsing whitespace, stripping comments, metadata and editor namespaces, rounding coordinates and squeezing to a single line. Choose Safe, Balanced or Aggressive presets and watch the live before/after size and percentage saved. Free, in-browser, nothing uploaded.

The GigAI SVG Minifier does one thing and does it hard: it makes an SVG as small as it can possibly be without changing what you see. Hand-authored and design-tool SVG is full of bytes that never render: comments, XML declarations, editor namespaces, doctype boilerplate, indentation, trailing whitespace, over-precise coordinates and default attributes. Paste your markup or drop a.svg file and the minifier collapses all of it in the browser, rounds path data to a precision you control, and emits a compact single-line string you can drop straight into HTML, JSX, a CSS data-URI or a JSON payload. Instead of a wall of options, it leads with three presets: Safe keeps IDs and title/desc and rounds gently, Balanced is the everyday sweet spot, and Aggressive squeezes the last few percent by stripping IDs, dimensions and metadata, with an escape hatch to fine-tune precision and each toggle when you need to. The headline is the size: a large before → after readout, the exact bytes and percentage saved, a visual savings bar and a gzipped estimate so you know the real transfer weight, not just the raw number. A live preview renders the minified result on a checkerboard so you can confirm at a glance that nothing broke, the one safety net a copy-paste minifier never gives you. Because everything runs client-side on your own machine, confidential logos, unreleased brand marks and internal icons are never uploaded. A dependency-free fallback keeps it minifying even if the engine chunk can't load, and closing the tab erases every trace.

Difficulty:
Easy
Typical time:
~10s
Processing:
100% browser processing

Last updated

How to use the svg minifier

  1. 1

    Paste or drop your SVG

    Paste markup into the editor, drop a .svg file anywhere on the workspace, or load a sample. The minified result and size readout appear immediately.

  2. 2

    Pick a preset

    Choose Safe, Balanced or Aggressive. Safe preserves IDs and title/desc. Aggressive squeezes the last few percent. Each preset sets precision and the strip toggles for you.

  3. 3

    Fine-tune if needed

    Open the advanced controls to nudge coordinate precision or flip an individual toggle (keep viewBox, remove width/height, remove IDs, remove title/desc) and watch it re-minify live.

  4. 4

    Check the preview & bar

    Glance at the checkerboard preview to confirm the graphic is unchanged and read the before → after bytes, percentage saved and gzip estimate.

  5. 5

    Copy or download

    Copy the single-line minified SVG, download it as a .svg, or share a link that reopens the tool with your source pre-loaded.

What SVG Minifier includes

  • One-click minify presets

    Safe, Balanced and Aggressive presets tune precision and every strip toggle for you, go from paste to the smallest sensible output in a single click, then fine-tune only if you want to.

  • True single-line output

    The result is collapsed to one clean line with no indentation, comments or line breaks: exactly the shape you want for inlining into HTML, JSX, a data-URI or a JSON string.

  • Big before → after readout

    The exact input and output bytes, a percentage-saved figure and a visual savings bar are front and centre, so the compression win is obvious the moment you paste.

  • Gzipped transfer estimate

    Beyond raw bytes, the minifier estimates the gzipped size, the number your server actually sends over the wire, so you're optimizing for real-world payload, not just file size on disk.

  • Live checkerboard preview

    The minified SVG renders live on a transparency checkerboard beside the code, so you can confirm the artwork is pixel-identical before you copy, the check a paste-and-pray minifier skips.

  • 100% client-side

    Minification runs entirely on your device. SVGs are never uploaded, stored or logged, and a dependency-free fallback keeps it working even if the engine chunk fails to load.

Why use our svg minifier

Smaller bundles and inline markup

Minified icons and logos routinely drop 30–70% versus their exported source. Multiply that across an icon set or a logo inlined on every page and it's measurable bytes off your HTML and your bundle.

Perfect for data-URIs and inline SVG

A single-line, whitespace-free string is exactly what a CSS background-image data-URI or an inlined <svg> in JSX wants. No escaping surprises, no stray newlines bloating the payload.

Confirm nothing broke

The live preview shows the minified result beside the source, so you catch the rare case where an aggressive precision setting clips a curve or a gradient before it ever ships.

No install, no upload, no config file

Get build-tool-grade minification without wiring up an svgo.config.js or a bundler plugin, and without sending confidential brand assets to someone else's server.

Built for the way you work

From quick one-off fixes to daily workflows, see how people put this tool to use.

  • Frontend developer

    Inline an SVG into JSX

    Minify a decorative or logo SVG to a single line before pasting it inline in a component, so the markup ships as tight as possible without a build step or an extra request.

  • CSS author

    Embed as a data-URI background

    Squeeze a small SVG hard enough to embed it as a background-image data-URI in a stylesheet without bloating the file, the single-line output drops in cleanly.

  • Design systems engineer

    Compress an icon set uniformly

    Run every icon through the same preset so your sprite or icon library is consistently minified and as small as possible before it hits the registry.

  • Email / Marketing

    Trim an SVG for a payload budget

    Minify a badge or illustration to fit inside a tight HTML email or ad payload budget, using the gzip estimate to confirm the real transfer size.

Supported formats

Accepts SVG, and produces SVG, all processed locally in your browser.

Input formats
  • SVG
Output formats
  • SVG

Frequently asked questions

Common problems, solved

Hit a snag? Here are quick fixes for the issues people run into most.

  • My SVG lost its scaling / renders at the wrong size after minifying.

    The viewBox was likely removed on the Aggressive preset. Switch to Balanced or open the advanced controls and turn 'Keep viewBox' back on: the viewBox is what lets an SVG scale to its container. For fluid sizing, keep the viewBox and enable 'Remove width/height' instead.

  • An icon in a sprite or referenced by CSS went blank.

    Aggressive minification strips IDs, and something outside the file still points at one (a <use>, a gradient, a clip-path or a CSS selector). Use the Balanced preset or disable 'Remove IDs'. The minifier can't see references that live outside the SVG.

  • Curves or gradients look slightly off.

    Coordinate precision is too aggressive for this artwork. Raise the precision a decimal or two and watch the preview, smooth gradients and tiny icons need more decimals than large flat shapes.

  • It says the input doesn't contain an <svg> element.

    The minifier needs raw SVG markup starting with an <svg> tag. If you pasted a base64 blob or a data-URI, decode it back to plain SVG first, or drop the .svg file directly.

Get the most out of it

  • Start with the Balanced preset, it's the everyday sweet spot. Only reach for Aggressive when you've confirmed nothing external references the SVG's IDs.

  • Precision 1–2 is plenty for large flat shapes. Bump it to 3+ for small icons or smooth gradients so curves stay crisp.

  • Minify before converting to a data-URI or a React component so the embedded markup starts as small as possible.

  • Watch the gzip estimate, not just raw bytes, that's the number that actually travels over the wire.

  • Keep 'Keep viewBox' on and enable 'Remove width/height' when you want the minified SVG to scale fluidly to its container.

What's new

Recent updates and improvements to the svg minifier.

  1. Initial release, client-side SVG minification with Safe / Balanced / Aggressive presets, single-line output, tunable precision and strip toggles, live checkerboard preview, before → after byte + gzip meter with a savings bar, copy, download, undo/redo and shareable links.

  2. Added a dependency-free fallback minifier so the tool keeps working when the engine chunk can't load, plus keyboard shortcuts and a curated set of sample SVGs.

  3. Refined the gzip estimate, added a visual savings bar and clearer preset guidance to prevent broken sprites when stripping IDs on the Aggressive preset.

Your privacy is built in

Your SVG is parsed and minified entirely in your browser. It is never uploaded to any server. Nothing is stored, logged or transmitted, so you can safely minify unreleased logos, brand marks and internal icon sets. If the engine chunk can't load, a built-in fallback minifier runs locally too. Close the tab and every trace is gone.

  • Runs in your browser
  • No uploads
  • Nothing stored

Ready to try the svg minifier?

Free, private and instant. SVG Minifier runs right in your browser.