SVG Path Editor

SVG Path Editor

Draw and edit SVG paths visually with Bezier curves. Create icons and shapes. Free online SVG path builder with code output

An SVG path is a string of letter-coordinate pairs: `M10 10 L 90 90` draws a line, `M10 10 Q 50 0 90 10` draws a quadratic Bezier. Hand-writing paths is feasible for triangles; for anything more complex, you need a visual editor where you drag points and see the path. This editor lets you click-add anchor points, drag control handles for curves, and exports clean SVG path strings ready to paste into <path d="..."/> elements.

The path commands you actually use

  • M x y — move to (x, y). Starts a new subpath. Almost every path starts with M.
  • L x y — line to (x, y). Straight line from the current point.
  • H x — horizontal line to x. Keeps y unchanged.
  • V y — vertical line to y. Keeps x unchanged.
  • Q cx cy x y — quadratic Bezier to (x, y) with one control point at (cx, cy).
  • C c1x c1y c2x c2y x y — cubic Bezier (smoother) with two control points.
  • A rx ry rot large sweep x y — arc to (x, y). Most complex; "rotate by rot, large arc flag, sweep flag".
  • Z — close path back to the most recent M.

Lowercase versions of every command (m, l, h, v, q, c, a, z) interpret coordinates as relative to the current point rather than absolute. Most tools generate absolute paths for clarity; some hand-optimization uses relative for compactness.

Working example: a heart shape

Input

A simple heart

Output

<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <path d="M50 80 Q20 50 20 35 Q20 20 35 20 Q50 20 50 35 Q50 20 65 20 Q80 20 80 35 Q80 50 50 80 Z" fill="red"/>
</svg>

Reading:
  M50 80     — start at bottom of heart
  Q20 50 20 35  — curve up and left through control point (20, 50) to the upper-left lobe
  Q20 20 35 20  — curve to top of left lobe
  Q50 20 50 35  — curve down to center top of heart
  Q50 20 65 20  — curve up to top of right lobe
  Q80 20 80 35  — curve to right edge
  Q80 50 50 80  — curve down and right to bottom of heart
  Z          — close back to start

Bezier curves let you create smooth shapes with few anchor points. A heart drawn with line segments would need 50+ points to look smooth; with quadratic Beziers, 4-6 anchor points suffice. The control points define the "pull" of the curve away from the straight line.

When you need each path type

  • Straight lines (L, H, V) — polygons, technical diagrams, isometric drawings.
  • Quadratic Bezier (Q) — soft curves. One control point per curve; computationally cheaper. Heart shapes, organic blobs.
  • Cubic Bezier (C) — full control. Two control points per curve; matches what design tools (Figma, Illustrator) produce. The "Bezier curve" people draw in tools is cubic.
  • Arc (A) — circular and elliptical arcs. The hardest command to hand-write because of the rotate/large/sweep flags. Best to use a tool for these.
  • Hidden state — M starts a subpath. Multiple Ms in one path create disconnected segments (e.g., the dot above a lowercase "i"). Z closes back to the most recent M.

Optimization for production

  • SVGO — the standard optimizer. Removes redundant commands (Q vs L for nearly-straight curves), reduces precision (8 decimals → 2 decimals), merges consecutive same-command operations.
  • Path simplification — Visvalingam or Ramer-Douglas-Peucker algorithms reduce point count while preserving visual shape. Useful for hand-drawn paths with too many points.
  • Decimal precision — 2-3 decimal places is usually enough for screen rendering at typical sizes. More precision = larger SVG files for no visual benefit.
  • Combine subpaths — multiple shapes in one <path> element with `M` separators is smaller than multiple <path> elements.
  • Stroke vs fill — outlining shapes is often smaller than filling. Compare both.

When to reach for this tool

  • You need a custom shape (icon, illustration) and want to draw it visually rather than in vector software, then export the path.
  • You inherited an SVG with a deeply-nested path and want to understand what each command produces — step through visually.
  • You are tweaking an icon's curve and want a live preview rather than guess-and-refresh.
  • You are learning SVG paths and want a sandbox to experiment with each command.

What this tool will not do

  • It will not replace Figma / Illustrator for complex illustration. Multi-path drawings, gradient fills, complex effects belong in real vector tools. Export from there and clean up here.
  • It will not animate paths. SVG path animation (path morphing, dashed offset for "draw-on" effects) is a separate concern; CSS / GSAP / anime.js handle it.
  • It will not convert bitmaps to paths. Tracing (Image → SVG) needs autotracing tools (Illustrator's Image Trace, Inkscape, online vectorizers).

Frequently asked questions

What is the difference between Q and C curves?

Q (quadratic Bezier) has one control point — defines a curve from start to end pulled toward that one point. C (cubic Bezier) has two control points — more flexibility, smoother, what design tools produce. Cubic can express anything quadratic can; quadratic is just shorthand for simpler curves.

Why does my path render as a "stroke only" when I want filled?

Check `fill` attribute. Default fill in SVG is black; if you set fill="none", you only see the stroke. Add `fill="red"` (or whatever color) to your path. Conversely if you see filled when you wanted just outline, set `fill="none"` and add `stroke="black"` `stroke-width="2"`.

How do I make my SVG scale to any size?

Use `viewBox` on the <svg> element with no width/height, OR with width="100%" height="100%". Avoid hardcoded width/height in pixels. The viewBox defines the internal coordinate system; width/height control the displayed size; they decouple cleanly.

Can I use SVG paths for icons in a font?

Yes — icon fonts (FontAwesome, etc.) are SVG paths packaged as font glyphs. In 2026 the trend is back to inline SVG sprites or <img src="icon.svg"> rather than icon fonts (accessibility, performance, and styling reasons). Hand-roll your sprite from optimized SVG paths.

How do I rotate or transform an SVG path?

Use SVG `transform` attribute or CSS `transform`. CSS transform is preferred — animates well, GPU-accelerated. Avoid bake-rotation into the path commands; rotated paths are unreadable and brittle.

Are SVG paths cached by browsers?

External SVG files (<img src="..."/>) cached normally. Inline SVG embedded in HTML loads with the page. Sprite sheets (one SVG file with many <symbol> definitions, referenced via <use>) provide the best of both — single HTTP request, individual symbols rendered as needed.

Related tools

Last updated · E-Utils editorial team