How to Animate SVG: A Beginner's Guide to CSS and SMIL
A friendly introduction to animating SVG: moving and colouring shapes with CSS, the line-drawing trick, SMIL animation, and when to reach for each approach.
Paste an SVG, choose a preset, and watch it come alive. Dial in the duration, easing, delay and loop count, preview it on any background, then copy a single self-contained animated SVG, or just the CSS keyframes. All in your browser, no sign-up, no watermark.
GigAI SVG Animation Generator adds CSS and SMIL animation to vector graphics - draw-on strokes, fades, spins and paths - with live preview and copy-ready output. It runs entirely in your browser, so proprietary artwork never leaves your machine.
The GigAI SVG Animation Generator adds motion to a static SVG without a timeline editor, a plugin, or a single upload. Drop in an icon, logo or illustration and pick a ready-made preset: spin for loaders, pulse for attention, bounce for playful entrances, fade for reveals, draw-line to trace strokes on like a signature, or morph to breathe between shapes: then shape the feel with duration, easing (linear, ease, ease-in-out or a smooth spring-like cubic-bézier), start delay, and iteration count (loop forever or run once). The tool writes the animation two ways so it fits any workflow: a self-contained animated SVG with an inlined <style> block of real @keyframes (drop it straight into a webpage, an <img>, or a component and it just moves), and a clean standalone CSS snippet you can paste into your own stylesheet to drive an external SVG. For maximum portability it can also emit SMIL <animate>/<animateTransform> elements that animate inside the file itself: handy where CSS on an SVG is stripped. A big live preview plays the result on a checkerboard, light or dark surface with a replay button so you can judge the timing against your real background, and undo/redo lets you walk back a setting you liked better. The draw-line preset measures each path so the stroke draws on cleanly, and every transform animates around the shape's own centre so spins and pulses don't drift off-frame. Because the entire engine (parsing, keyframe generation and preview) runs locally, your unreleased logos and client assets never leave the tab, and the exported file works offline forever.
Last updated
Paste SVG markup, drop a .svg file, or load one of the built-in samples. The static artwork appears in the live preview immediately.
Choose spin, pulse, bounce, fade, draw-line or morph. The preview starts animating so you can see the motion right away.
Adjust duration, easing, delay and iteration count. Switch output between an inlined CSS <style> block and native SMIL if a target strips CSS.
Copy the self-contained animated SVG, grab just the CSS keyframes, or download the .svg. Everything is generated locally in your browser.
Spin, pulse, bounce, fade, draw-line and morph cover loaders, attention cues, entrances, reveals and stroke-tracing, one click applies the preset, then you fine-tune it.
Set duration in seconds, choose linear / ease / ease-in-out / spring easing, add a start delay, and loop forever or run the animation exactly once.
Output is one file with an inlined <style> block of real @keyframes. Paste it into a page, an <img> or a component and it moves on its own, no external CSS required.
Prefer to drive an external SVG from your stylesheet? Copy just the standalone @keyframes and animation shorthand, scoped to a class you can rename.
Emit native <animate>/<animateTransform> elements that live inside the SVG itself for environments where CSS applied to an SVG gets stripped.
Watch the animation loop on a checkerboard, light or dark surface, hit replay to restart the run-once presets, and undo/redo any setting you change your mind about.
Get a spinning loader, a pulsing badge or a drawing-on logo without After Effects, Lottie or a paid plugin: just paste the SVG and copy the animated result.
Take the self-contained animated SVG when you want a drop-in file, or the standalone CSS keyframes when you'd rather keep markup and motion separate in your codebase.
Spins and pulses animate around the shape's own centre and draw-line measures each path, so animations stay in-frame and look intentional instead of drifting.
Parsing, keyframe generation and preview all run on your device. Your unreleased logos and client work never leave the tab, and the exported file plays offline.
From quick one-off fixes to daily workflows, see how people put this tool to use.
Turn a plain spinner or logo into a smooth spinning or pulsing loader, then paste the self-contained SVG straight into a component. No extra CSS file to wire up.
Use draw-line to trace a monoline logo on, or fade to reveal it, and hand engineers a single animated SVG that behaves the same everywhere without a video export.
Add a subtle pulse to a notification badge or a bounce to an empty-state illustration, tune the loop and delay, and drop the copy-ready markup into the design system.
When CSS on an SVG gets stripped, switch to SMIL so the motion lives inside the file itself and survives in environments that ignore external or inline styles.
Accepts SVG, and produces SVG and CSS, all processed locally in your browser.
Generate smooth, organic SVG blob shapes with sliders for complexity, edge contrast and size, solid or gradient fills, and a seeded re-roll, then copy the SVG or download SVG/PNG. 100% in your browser.
Minify and clean SVG files in your browser with SVGO, strip editor metadata, round coordinates, drop hidden layers and see the exact bytes and percentage saved. Nothing is uploaded.
Convert SVG to a clean React component in your browser, camelCased attributes, TypeScript or JS, memo, forwardRef and React Native output, with a live preview. Nothing is uploaded.
Open, paste or drop an SVG to view it on a checkerboard, light or dark canvas with zoom, live dimensions, a source-code pane and a full element/color report: 100% in your browser, nothing uploaded.
Convert SVG to a CSS background-image or mask rule in your browser: a compact URL-encoded data URI with a ready selector snippet, live preview and one-click copy. Nothing is uploaded.
Generate full-bleed hero and section backgrounds as clean SVG: mesh gradient, dots, grid, waves or blob styles with your brand colors, opacity and density, plus a reproducible re-roll. Copy the SVG or CSS, download SVG/PNG. 100% in your browser.
Hit a snag? Here are quick fixes for the issues people run into most.
Draw-line animates stroke-dashoffset, so it needs a stroked path: an outline, not a filled solid. Give your path a stroke (and no fill, or fill applied after) so there's a line to trace on. Closed filled icons won't show a drawing effect.
Some renderers drop inline CSS applied to SVG. Switch the output mode to SMIL so the <animate> elements live inside the file, or reference the standalone CSS from a real stylesheet in environments that allow it.
That happens when a transform-origin is off-centre. This tool centres rotations on the shape's own bounding box, so re-apply the preset here. If you hand-edited the transform afterwards, remove your override and let the generated centre take over.
Morph tweens scale/shape subtly on the whole graphic. On a single tiny path the movement can be hard to see. Increase the duration, raise the loop count, or apply it to a shape with more visible area to read the effect.
Keep loader spins between 0.8s and 1.5s, faster reads as frantic, slower as sluggish.
Use ease-in-out or the spring easing for entrances (bounce, fade). Reserve linear for continuous spins so they don't stutter at the loop seam.
Draw-line looks best on monoline / outline icons where every path has a stroke and no heavy fill.
Set iterations to 'once' for reveals you only want on load, and 'infinite' only for ambient loaders.
Grab the standalone CSS when your SVG already lives in the DOM. It keeps markup and motion cleanly separated.
Recent updates and improvements to the svg animation generator.
Initial release, spin, pulse, bounce, fade, draw-line and morph presets with duration, easing, delay and iteration controls, live preview and self-contained animated SVG output.
Added standalone CSS keyframe export, SMIL output mode for restrictive renderers, and centred transforms so spins and pulses stay in-frame.
Added undo/redo, keyboard shortcuts, a replay button for run-once animations, and checkerboard/light/dark preview surfaces.
Your SVG is parsed, animated and previewed entirely in your browser, the keyframe generation, the SMIL injection and the live preview all run locally on your device. Nothing is uploaded, stored or logged, so unreleased logos and client assets stay private. The preview strips executable content (scripts, event handlers, javascript: URLs) for safety, it works offline, and closing the tab leaves nothing behind.
Free, private and instant. SVG Animation Generator runs right in your browser.