Vector .svg download, free

Updated November 21, 2026 by Ryan Doyle, who built Pie Chart Generator.

SVG Donut Chart Generator

An SVG donut chart is a ring split into arcs, one per value, saved as vector code that stays sharp at any size. Make one below: type or paste your values, set the hole with the slider, and download the .svg. To write one by hand, copy the code further down; the math is worked out for you.

Enter your values

Type, paste two columns, or upload a CSV

Label
Value
%
Live preview active
Total: 100

Donut preview

Choose SVG when you download

Made with pie-chart-generator.com
My Pie Chart Data
CategoryValuePercentage
Category A3030.0%
Category B2525.0%
Category C2020.0%
Category D1515.0%
Category E1010.0%

Categories

5

Total Value

100

Chart Type

pie

Chart Settings

0°

Export Chart

Slide-ready HD export without watermark

Drop clean 2,712 px PNG or vector SVG straight onto dark or colored slides.

Standard free download (1,356 px)Includes small credit line

No account required. Instant activation in this browser.

Donuts are the chart people want as SVG

People who make a donut on this site download it as SVG two and a half times as often as people who make a pie. From January 29 to November 20, 2026, 24.1% of the 3,686 donut charts downloaded were .svg files, against 9.6% of 16,112 pies. Donuts were 18.1% of all downloads here but 35% of the 2,537 SVG downloads.

The SVG donuts are small. The median one had 4 segments, and the most common size was two (250 of 887). We don't store what the numbers mean, but two segments is the shape of a progress ring: one share against the rest.

Chart typeDownloadsAs SVGSVG share
Donut3,68688724.1%
Pie16,1121,5399.6%

Source: this site's own anonymous download log, January 29 to November 20, 2026, counted by us on November 21, 2026. Editor charts only; no chart contents are stored.

What is inside the .svg you download

  • One <path> per segment, drawn with two arc commands: along the outside edge, across to the hole, and back along the inside edge. Each segment has a 2-pixel white outline, which is what makes the gaps between colors.
  • The first segment starts at 12 o'clock and the rest follow clockwise. The rotation control moves that starting point.
  • The hole is a share of the outer radius. It starts at 40% when you switch a chart to Doughnut, this page opens at 50%, and the slider runs from 10% to 80%.
  • Slice labels (percentage, value or name, whichever you pick) and the legend are plain <text> elements, so you can restyle or translate them in Figma, Illustrator, Inkscape or a text editor.
  • Free downloads add one small "Made with pie-chart-generator.com" text line in the corner. Pro, from $1 a month, removes it and can leave out the background.
  • The file has no <title> or <desc>. If you inline it in a web page, add the two lines and role="img" from the code below so screen readers can name the chart.

Hand-code an SVG donut chart

The shortest donut is one stroked circle per value. Give every circle a radius of 15.9155: its circumference is then 2 × π × 15.9155 = 100, so a 30% segment is simply stroke-dasharray="30 70". Each circle's stroke-dashoffset is minus the sum of the segments before it, and rotate(-90 21 21) moves the start from 3 o'clock, where an SVG circle begins, to 12 o'clock.

<svg viewBox="0 0 42 42" width="240" height="240"
     role="img" aria-labelledby="donut-title donut-desc">
  <title id="donut-title">Visits by source</title>
  <desc id="donut-desc">Search 45%, Social 30%, Email 25%</desc>
  <g transform="rotate(-90 21 21)" fill="none" stroke-width="6">
    <!-- r = 15.9155, so the circumference is 100 -->
    <circle cx="21" cy="21" r="15.9155" stroke="#2563EB"
            stroke-dasharray="45 55" stroke-dashoffset="0"/>
    <circle cx="21" cy="21" r="15.9155" stroke="#16A34A"
            stroke-dasharray="30 70" stroke-dashoffset="-45"/>
    <circle cx="21" cy="21" r="15.9155" stroke="#B45309"
            stroke-dasharray="25 75" stroke-dashoffset="-75"/>
  </g>
  <text x="21" y="21" text-anchor="middle" dominant-baseline="central"
        font-size="7" font-weight="700" fill="#111827">45%</text>
</svg>
Visits by sourceSearch 45%, Social 30%, Email 25%45%

The code on the left, rendered.

Prefer a round radius such as 16? Add pathLength="100" to each circle instead. MDN describes it as setting the total length the browser uses for distance calculations, so stroke-dasharray is then measured against 100 whatever the radius. The 15.9155 radius does not need the attribute.

Dash values for common splits

With the 15.9155 radius, each segment's dasharray is its share and the rest of 100, and its offset is minus the shares before it:

SplitSegment 1Segment 2Segment 3Segment 4
75 / 2575 25, offset 025 75, offset -75--
60 / 4060 40, offset 040 60, offset -60--
45 / 30 / 2545 55, offset 030 70, offset -4525 75, offset -75-
50 / 30 / 2050 50, offset 030 70, offset -5020 80, offset -80-
40 / 30 / 20 / 1040 60, offset 030 70, offset -4020 80, offset -7010 90, offset -90

From an array of values

// values -> one <circle> per segment (circumference 100)
function donutSvg(rows, { size = 240, ring = 6 } = {}) {
  const total = rows.reduce((n, r) => n + r.value, 0);
  let start = 0;
  const arcs = rows.filter((r) => r.value > 0).map((r) => {
    const pct = (100 * r.value) / total;
    const circle = `<circle cx="21" cy="21" r="15.9155" stroke="${r.color}"
      stroke-dasharray="${pct} ${100 - pct}" stroke-dashoffset="${-start}">
      <title>${r.label}: ${pct.toFixed(1)}%</title></circle>`;
    start += pct;
    return circle;
  });
  return `<svg viewBox="0 0 42 42" width="${size}" height="${size}" role="img">
    <g transform="rotate(-90 21 21)" fill="none" stroke-width="${ring}">
      ${arcs.join("")}</g></svg>`;
}

Each segment carries its own <title>, so hovering it shows the label and share as a native tooltip.

Three ways to draw a donut, compared

MethodBest forWatch out for
Stroked circles (dasharray)Hand-written code, progress rings, animating a ring as it fillsRound line caps stick out past each end and overlap the neighbor, so keep stroke-linecap at its default, butt, on multi-segment rings
Path arcs (A commands)Exact filled shapes that design tools treat as ordinary objects; what this site's download usesMore trigonometry; one arc can't draw a full 100% ring because its start and end points match, so split it into two half arcs
CSS conic-gradientA decorative ring in a page's CSS with no SVG at allNot an SVG: nothing to download or open in a design tool, and no per-segment title or hover

Labels, gaps and the edge cases

Labels on the ring. Put each label at its segment's middle angle on the 15.9155 circle, outside the rotated group so the text stays upright. Skip labels on segments under about 5%; there is no room, and the legend covers them.

θ = (start + value / 2) / 100 × 360° − 90°
x = 21 + 15.9155 × cos θ
y = 21 + 15.9155 × sin θ

Social: start 45, value 30 → midpoint 60 → θ = 126°
x = 21 + 15.9155 × (−0.588) ≈ 11.6
y = 21 + 15.9155 × 0.809  ≈ 33.9
  • For gaps between segments, shorten each dash by the gap and shift it by half the gap. A 1-unit gap on the Social segment is stroke-dasharray="29 71" with stroke-dashoffset="-45.5".
  • When rounded shares don't add to 100, draw from the unrounded ones, and for the printed labels give the leftover point to the segment with the largest remainder. Three equal thirds print as 34, 33 and 33.
  • Leave zero values out. A zero-length dash draws nothing but still adds an element, a tooltip and possibly a stray label on top of its neighbor's.
  • A single 100% value is stroke-dasharray="100 0", which draws the whole ring.

SVG donut chart questions

Sources: MDN Web Docs, "pathLength" attribute reference (last modified November 12, 2026), read November 21, 2026. The export behavior described above was read from this site's own export code on November 21, 2026. Download counts: this site's anonymous download log, counted November 21, 2026.