SVG PlaygroundSVG BasicsHello SVG
0/44 lessons
SVG BasicsHello SVG
SVG stands for Scalable Vector Graphics — pictures described by math, not pixels, so they stay crisp at any size. Everything lives inside an <svg> element. The viewBox="minX minY width height" sets the internal coordinate grid. Edit the numbers below and watch the shape update instantly.
SVG Editor
Preview
Check
What does the viewBox attribute define?
1 / 44

SVG Playground — Learn SVG from Basics to Animation

A free interactive SVG playground with 44 guided lessons, live preview, a transparency grid, animation replay, progress tracking, and share links. No install.

Updated July 24, 2026
Share & Support

What's included

Features

44 guided lessons across 12 chapters, from your first circle to morphing paths — then keep building motion in the GSAP playground
Live SVG editor — the preview updates as you type, Ctrl+Enter to render immediately
Transparency grid, white, and dark preview backgrounds to check any graphic in context
Replay button restarts CSS and SMIL animations from the start
Basic shapes chapter — rect, circle, ellipse, line, polyline, and polygon
Paths chapter — M, L, Z, quadratic (Q), cubic (C), smooth (T), and arcs (A)
Styling chapter — fill, stroke, stroke-dasharray, opacity, linecap, and linejoin
Gradients & patterns — linearGradient, radialGradient, and tiled patterns
Text & groups — text-anchor, tspan, textPath on a curve, and <g> grouping
Transforms & reuse — translate/rotate/scale, <use>, <defs>, and <symbol> sprites
Filters chapter — drop shadow, Gaussian blur, neon glow, and feColorMatrix
Clipping & masking — clipPath for hard edges and mask for soft, feathered edges
CSS animation — transitions, @keyframes, transform-box, and staggered delays
SMIL animation — animate, animateTransform, animateMotion, keyTimes, repeatCount
Pro techniques — self-drawing lines, spinners, animated icons, and animated gradients
Progress tracking via localStorage — resume exactly where you left off
Copy, download as .svg, and share via a base64 URL — pair it with the SVG animation generator
100% browser-based — no design software, no build step, no setup

About this tool

Learn SVG Online Without Installing Anything — 44 Lessons, Live Browser Preview

Most SVG tutorials paste a finished graphic and move on, so you never learn what each number in the markup actually controls. This SVG Playground keeps the code and the rendered picture side by side. Change a coordinate, a colour, or an animation value and the preview updates instantly — that tight feedback loop is how SVG finally clicks.

There is nothing to install. No design software, no Node.js, no build step. Open the page and 44 lessons are ready across 12 chapters that take you from your first <circle> all the way to self-drawing lines, morphing paths, and animated gradients.

SVG Basics — the mental model everything builds on

The first chapter establishes how SVG thinks. You learn that a drawing lives inside an <svg> element, that the viewBox defines an internal coordinate grid you can zoom and pan independently of the on-screen size, and — the thing that trips up every beginner — that the y-axis grows downward from a top-left origin. Interactive picker lessons let you zoom in, zoom out, and pan the same shape so the viewBox stops being abstract.

Basic Shapes — rect, circle, ellipse, line, polyline, polygon

Before paths, you master the primitives. Rectangles with x, y, width, height, and the rx that rounds corners into pills. Circles and ellipses with cx, cy, and one or two radii. Lines and polylines that need a stroke to appear. Polygons that auto-close into triangles, hexagons, and stars from a list of points. Each shape renders live so you can drag the numbers and watch it respond.

Paths — the one element that can draw anything

The <path> and its d attribute are the heart of SVG. You learn the mini-language one command at a time: M to move the pen, L to draw a line, Z to close. Then curves — the quadratic Q with one control point, the cubic C with two (the kind design tools export), and the smooth T shorthand for waves. An arc lesson demystifies the A command and its two flags, and a final lesson builds a real heart icon from arcs, exactly like the single d string you copy out of Figma or Illustrator.

Styling & Strokes — fill, stroke, dashes, caps, and joins

Colour and line treatment get their own chapter. fill versus stroke and stroke-width, fill="none" for outline-only shapes, and colour in hex, rgb(), hsl(), or currentColor. Then the stroke details that make graphics feel polished: stroke-dasharray for dashes and dots, stroke-dashoffset (which becomes the key to line-drawing animation later), opacity and layering, and stroke-linecap and stroke-linejoin for soft rounded ends and corners.

Gradients & Patterns — depth without images

Define a <linearGradient> or <radialGradient> once inside <defs>, give it an id, and reference it with fill="url(#id)". You learn to place <stop> colours, rotate a linear blend with its coordinates, and shift a radial focal point to fake a light source for spheres and glows. A <pattern> lesson tiles small artwork across a shape for dots, grids, and hatching — all vector, all resolution-independent.

Text & Groups — labels, badges, and organisation

SVG text is a first-class citizen. You place <text> at a baseline, align it with text-anchor, and style it with the same font-size, font-weight, and letter-spacing you know from CSS. A <tspan> restyles part of a line, <textPath> flows words along any curve for circular badges, and <g> groups elements so a single fill or transform cascades to every child.

Transforms & Reuse — translate, rotate, scale, and DRY graphics

The transform attribute moves, rotates, and scales with translate, rotate, and scale, and you learn how chaining and anchor points behave. Then reuse: define a shape once and stamp it many times with <use href="#id">, and package scalable icons with <symbol> and its own viewBox — the exact foundation of SVG icon sprites.

Filters & Effects — shadows, blur, glow, and colour

Filters live in <defs> and apply with filter="url(#id)". You build a soft drop shadow with <feDropShadow>, blur with <feGaussianBlur>, a neon glow by merging a blurred copy behind the original with <feMerge>, and recolour graphics with <feColorMatrix> for greyscale and hue-rotate effects — the same primitives that power the CSS filter property.

Clipping & Masking — cropping with hard and soft edges

A <clipPath> crops an element to a shape with a hard edge — the classic circular avatar. A <mask> uses brightness instead, so white shows, black hides, and grey fades, giving the feathered edges a clip path cannot. Seeing both back to back makes the difference obvious.

Animation: CSS — transitions, keyframes, and the transform-origin gotcha

The first animation chapter uses plain CSS inside a <style> block. A hover lesson shows a transition smoothly interpolating scale and colour. A @keyframes picker builds spin, pulse, and bounce — and teaches the single most common SVG-animation mistake: transforms are measured from the SVG origin, so you need transform-box: fill-box and transform-origin: center to rotate in place. A staggered lesson uses animation-delay to build an equaliser wave.

Animation: SMIL — animate, animateTransform, animateMotion

The second animation chapter uses SVG's built-in SMIL — no CSS, no JavaScript. You drop an <animate> inside a shape to animate an attribute through a values list, use <animateTransform> for rotate, scale, and translate, and <animateMotion> to send an element gliding along a path with rotate="auto". A timing lesson covers begin, keyTimes, and repeatCount so you can sequence and hold precisely.

Pro Techniques — the effects people actually ship

The final chapter combines everything into portfolio-grade effects: the self-drawing line built from stroke-dasharray and an animated stroke-dashoffset; a dependency-free spinner; animated check and heart icons; path morphing by animating the d attribute between shapes with matching structure; a living animated gradient; and production-ready responsive, accessible markup with preserveAspectRatio, <title>, and role="img".

Every lesson has a Quick Check multiple-choice question, and progress is saved to localStorage so you can close the tab and resume where you left off. The Replay button restarts any animation, the background toggle switches between a transparency grid, white, and dark, and everything renders locally — no code is uploaded to any server. When you are ready to go further with motion, continue in the GSAP playground or the CSS animation generator.

Step by step

How to Use

  1. 1
    Open the playground — no install requiredNavigate to the SVG Playground. The editor and live preview are ready immediately — no design software, no Node.js, no build step. Start from the first lesson or jump to any chapter that matches your level.
  2. 2
    Start with SVG Basics if you are newWork through Hello SVG, The viewBox, and The Coordinate System first. These three lessons build the mental model — the <svg> element, the coordinate grid, and the downward y-axis — that every later chapter assumes.
  3. 3
    Master shapes before pathsThe Basic Shapes chapter covers rect, circle, ellipse, line, polyline, and polygon. Drag the numbers in the editor and watch each shape respond. Once shapes feel natural, the Paths chapter and its d-attribute commands (M, L, Q, C, A, Z) are far easier to read.
  4. 4
    Use the background toggle to check your workSwitch the preview background between the transparency grid, white, and dark using the buttons above the preview. The checkerboard grid reveals transparent areas, while white and dark show how the graphic looks on real page backgrounds.
  5. 5
    Work through both animation chaptersThe CSS Animation chapter teaches transitions, @keyframes, and the transform-box gotcha; the SMIL Animation chapter teaches the built-in animate, animateTransform, and animateMotion elements. Press Replay above the preview to restart any animation and watch it again.
  6. 6
    Build the Pro Techniques effectsThe final chapter assembles everything into shippable effects — self-drawing lines, a spinner, animated icons, path morphing, and animated gradients. These are the graphics you will actually reuse in real projects.
  7. 7
    Answer the Quick Check on each lessonMost lessons end with a multiple-choice Quick Check. Answer it before marking the lesson done — it reinforces the concept and takes under a minute. Progress is saved automatically to localStorage.
  8. 8
    Share, download, and reuse your SVGClick Download to save the current markup as a .svg file, or Share to copy a base64 URL of your code. Both work on your own SVG too — paste an exported icon into the editor and tweak it live.

Real-world uses

Common Use Cases

Learn SVG from scratch in your browser
If you want to understand SVG but do not know where to begin, open the SVG Basics chapter. The viewBox, coordinate system, and basic shapes are all explained with markup that renders instantly after every edit. No design software, no configuration — the 12-chapter path takes you from your first circle to animated, responsive graphics.
Understand SVG paths and Bézier curves
Paths are where most people give up on SVG. The Paths chapter teaches the d-attribute one command at a time — M, L, Z, then quadratic (Q) and cubic (C) curves, then arcs (A) — with control points drawn on screen. By the end you can read and edit the single d string a design tool exports for any icon.
Master SVG animation — CSS and SMIL
Two chapters cover animation in depth. Learn CSS transitions and @keyframes (including the transform-box fix for rotations), then the built-in SMIL elements animate, animateTransform, and animateMotion. Pro lessons build self-drawing lines, spinners, animated icons, path morphing, and animated gradients — effects you can drop straight into a site.
Learn gradients, filters, clipping, and masking
Add depth without images. Build linear and radial gradients, tiled patterns, drop shadows and neon glows with SVG filters, and crop graphics with clipPath (hard edges) or mask (soft, feathered edges). These are the techniques behind polished logos, avatars, and hero graphics.
Build reusable icons and sprites
Define a shape once and reuse it with <use>, then package scalable icons with <symbol> and its own viewBox — the foundation of SVG icon sprites. Combine with groups and transforms to keep complex illustrations organised and DRY.
Use it as a fast SVG scratchpad
Ignore the lessons and paste any SVG into the editor — an exported icon, a logo, or hand-written markup. The live preview, transparency grid, animation replay, copy, download, and share controls all work on your own code. Faster than spinning up a design tool for a quick tweak.

Got questions?

Frequently Asked Questions

No. The SVG Playground runs entirely in your browser. You can edit SVG markup, see it render live, toggle a transparency grid, replay animations, and save progress without installing an editor, Node.js, or any design software.

Yes. The first chapters start with the <svg> element, the viewBox and coordinate system, and basic shapes — rect, circle, ellipse, line, polyline, and polygon — with the drawing rendering instantly after every edit. No prior SVG or graphics experience is needed.

Yes. Two full chapters cover it. The CSS chapter teaches transitions, @keyframes, transform-box, transform-origin, and staggered delays. The SMIL chapter teaches animate, animateTransform, animateMotion, begin timing, keyTimes, and repeatCount. Pro lessons then build self-drawing lines, spinners, animated icons, path morphing, and animated gradients.

CSS animation uses a <style> block with transitions and @keyframes and is great for hover effects and reusable classes. SMIL is built into SVG with animate, animateTransform, and animateMotion — it can animate almost any attribute, including a path’s d for morphing, with no CSS or JavaScript. The playground teaches both.

Your SVG renders in a sandboxed preview that updates as you type. You can switch the background between a transparency grid (checkerboard), white, or dark, and press Replay to restart CSS and SMIL animations from the beginning.

Yes. Ignore the lesson path and paste any SVG — an icon exported from a design tool, a logo, or hand-written markup. The live preview, background toggle, copy, download, and share controls all work on your own code.

Yes. Download saves the current markup as a .svg file you can use anywhere. Share copies a link that encodes your SVG in the URL — nothing is uploaded to a server.

CSS transforms on SVG elements are measured from the SVG origin, not the shape’s centre. Add transform-box: fill-box and transform-origin: center so the rotation pivots around the shape. The CSS animation lessons cover this exact gotcha.

For icons, logos, and illustrations, usually yes. SVG is vector-based, so it stays sharp at any size and screen density, files are often tiny, and you can style and animate it with CSS. Raster formats like PNG and JPG are better for photographs.

Keep the viewBox and remove any fixed width and height so it scales to fill its container. Use preserveAspectRatio to control fitting, and add a <title> and role="img" for accessibility. The final Pro Techniques lesson walks through it.