<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"> </svg>
SVG Animation Generator — CSS, SMIL & GSAP Online Tool
What's included
Features
About this tool
Animate Any SVG Online — CSS, SMIL, or GSAP — Download as Animated SVG or HTML
You have an SVG icon or illustration and want it to rotate, bounce, draw its own stroke, or orbit along a path — but writing CSS @keyframes for SVG properties or looking up the <animateTransform> SMIL syntax from scratch is a significant time investment. Upload the SVG here, pick a preset, and download the animated file.
Three animation engines, each for a different need. The CSS engine embeds @keyframes in a <style> block inside the SVG — zero JavaScript, works as inline SVG, <img> src, or CSS background-image. 17 presets including Rotate, Bounce, Float, Draw Stroke (the popular stroke-dashoffset draw-on effect), Marching Ants, and Glow. The SMIL engine uses native <animate> and <animateTransform> elements baked into the SVG markup — maximum portability across SVG renderers. The GSAP engine adds elastic easing, Orbit via MotionPathPlugin, and Figure-8 motion paths that CSS and SMIL cannot produce — output is a self-contained HTML file with GSAP loaded from CDN.
Upload any SVG file and the tool extracts each element (path, circle, rect, group) as an independently animatable layer. Adjust duration, delay, easing, and repeat count per animation with live preview. Because SVG is vector, the animated output is sharp at any screen resolution — the same file looks correct on a laptop, 4K monitor, and Retina iPhone, and is typically smaller than an equivalent GIF with no runtime JavaScript required for CSS or SMIL animations.
Step by step
How to Use
- 1Add a shape or upload your SVGStart by either adding a built-in shape — click any shape button at the top of the canvas to add a circle, rectangle, ellipse, star, heart, arrow, triangle, line, or text element — or click Upload SVG to load an existing SVG file. When you upload an SVG, the tool parses the markup and extracts each child element (path, circle, rect, g, etc.) as a separate, independently animatable layer in the layers panel. You can also draw freehand shapes directly on the canvas using the draw mode. Import a raster image first with the Image to SVG converter, then bring it here to animate.
- 2Choose an animation engineSelect your animation engine from the three tabs above the presets panel. Choose CSS for zero-dependency animated SVG — @keyframes are embedded inside a <style> block in the SVG, so the file works as an <img> src, inline SVG, or CSS background-image with no JavaScript. Choose SMIL for native SVG animation elements (<animate>, <animateTransform>) baked into the markup — maximum portability across SVG renderers including email clients and some desktop apps. Choose GSAP for the most sophisticated animations: elastic easing, Orbit via MotionPathPlugin, Figure-8 motion paths — output is a self-contained HTML file.
- 3Click a preset to apply itBrowse the preset list on the left and click any preset name — the canvas preview plays the animation immediately. For CSS and SMIL: Rotate, Spin CCW, Pulse, Zoom In, Bounce, Float, Move Right, Shake, Wiggle, Skew, Fade, Blink, Color Cycle, Rainbow, Draw Stroke (the stroke-dashoffset draw-on effect), Write On, and Erase. For GSAP: all CSS presets plus Elastic, Orbit (circular path via MotionPathPlugin), and Figure-8. The Draw Stroke preset is especially popular — it progressively reveals a stroked path as if drawing itself, used for logo reveals, signature animations, and diagram walkthroughs.
- 4Fine-tune duration, delay, easing, and repeatUse the animation controls panel to adjust the parameters. Set Duration in seconds — shorter for snappy micro-animations, longer for flowing motion. Set Delay to stagger multiple layers. Choose an Easing function from the dropdown: ease, linear, ease-in, ease-out, ease-in-out, bounce, or elastic (GSAP only). Set Repeat count — use "infinite" for a looping icon, or "1" for a play-once animation that holds the end state with animation-fill-mode: forwards. Click the Replay button at any time to restart the animation from the beginning and preview the result.
- 5Animate multiple layers independentlySelect any layer in the layers panel to animate it separately from other elements. Each layer can have its own preset, duration, delay, and easing — allowing complex multi-part animations like a logo where the background fades in, then the wordmark draws itself, then an icon bounces. Reorder layers with drag-and-drop, duplicate a layer to copy its animation settings as a starting point, or delete unused elements. Undo and redo are available throughout the session.
- 6Export the animated fileClick Export SVG to download an animated .svg file for CSS and SMIL animations — this is a single portable file with all animation code embedded. Click Export HTML for GSAP animations — the HTML file includes GSAP and MotionPathPlugin loaded from the GreenSock CDN plus all timeline code, ready to open in any browser. Click Copy Code to copy just the animation block (the CSS @keyframes rules, SMIL elements, or GSAP script) if you want to manually integrate the animation into an existing SVG or HTML file.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
CSS animation embeds @keyframes rules in a <style> block inside the SVG file — zero JavaScript, works as inline SVG, <img> src, or CSS background. SMIL uses native SVG animation elements (<animate>, <animateTransform>) baked into the markup — also zero JavaScript and maximum portability. GSAP is a JavaScript library enabling richer animations like elastic easing, motion paths, and timeline sequencing. GSAP output is a self-contained HTML file rather than a standalone SVG. For icons and simple illustrations use CSS; for complex interactive animations use GSAP.
Use the Draw Stroke CSS preset. The technique sets stroke-dasharray to the total path length and animates stroke-dashoffset from that length down to 0 — as the offset decreases, progressively more stroke becomes visible, creating the "drawing itself" illusion. The preset calculates the values automatically. It works on any <path>, <circle>, or <line> element that has a visible stroke. This is used for logo reveals, signature animations, and diagram walkthroughs.
Yes. Upload any .svg file and the tool parses the SVG XML, extracting each child element (circle, rect, path, g, etc.) as a separate layer. Click any layer to select it, then apply CSS, SMIL, or GSAP presets to that specific element independently. Gradients, clip-paths, and filter definitions from the original SVG are preserved in the exported output.
CSS and SMIL animated SVGs play correctly when used as an <img> src or CSS background-image — the animation is embedded in the SVG file itself, no JavaScript context is needed. GSAP animations require JavaScript and only work when the SVG is inline in the HTML (not as <img> src or background-image). For maximum portability across embedding contexts, use the CSS engine.
Only free GSAP plugins are used: GSAP Core and MotionPathPlugin. Both are free for commercial projects under the GreenSock Standard License. The paid Club GreenSock plugins (MorphSVG, DrawSVG, SplitText, ScrambleText) are not included. The exported HTML loads GSAP from the official GreenSock CDN — no npm install or local files needed.
For React, use the CSS engine output — export the animated SVG, then either inline it as a JSX component (converting SVG attributes to camelCase) or import it with next/image or as a module. CSS animations embedded in the SVG file play correctly in both cases. For GSAP animations in React, the exported HTML is a reference — recreate the animation using the @gsap/react package in your component.
CSS @keyframes animations embedded in SVG work in all modern browsers: Chrome, Firefox, Safari, and Edge. SMIL animations work in Chrome, Firefox, and Safari. Both are supported without vendor prefixes. The main compatibility caveat is that animations in SVG used as <img> src or CSS background-image are restricted from JavaScript and network access — but pure CSS and SMIL animations play correctly in those contexts.
Animated SVG with CSS is usually the better choice for simple icons — it requires zero JavaScript, has no runtime dependency, and the file is typically 1–5 KB. Lottie requires a 60–70 KB JavaScript library (lottie-web) plus the JSON animation file. Use Lottie when you need timeline scrubbing, complex After Effects animations with masks and mattes, or interactivity that CSS animations cannot support. For a loading spinner, bounce icon, or draw-stroke logo, an animated SVG is the lighter and simpler solution.