N
NJHTools

Pie Chart Maker

Type labels and values as Mermaid text and get a pie chart with percentages computed for you, plus live preview and SVG or PNG export. Free, no signup, and it runs in your browser.

Zoom
100%
Export
Mermaid code7 lines

Tab inserts spaces. Press Esc, then Tab, to move focus out. Autosaved in this browser.

PreviewLoading Mermaid…

Rendering…

Example pie chart code

This is the Mermaid source loaded in the editor above. Copy it into a Markdown file inside a ```mermaid block and GitHub, GitLab, Notion or Obsidian will render it.

pie showData
    title Where visitors come from
    "Organic search" : 48
    "Direct" : 22
    "Social" : 15
    "Referral" : 10
    "Email" : 5

Pie chart syntax cheat sheet

SyntaxWhat it does
pieStart a pie chart.
pie showDataAlso print the raw values in the legend.
title TextChart title.
"Label" : 42One slice. Labels must be quoted; values are positive numbers (decimals allowed).
PercentagesComputed automatically from the values; they do not need to sum to 100.

How to make a Mermaid pie chart

  1. 1Start the code with pie and an optional title.
  2. 2Add one slice per line, such as "Mobile" : 62.
  3. 3Add showData after pie to print raw values in the legend.
  4. 4Check the live preview.
  5. 5Export as SVG or PNG, or copy a share link.

Pie chart syntax

Write pie title Traffic by device on the first line, then one slice per line: a quoted label, a colon and a positive number. Mermaid works out the percentages, so the numbers do not need to add up to 100.

Writing pie showData shows the actual values next to the labels in the legend.

When a pie chart works

Pie charts are best for a few parts of one whole, ideally five or fewer slices. Beyond that, slices become hard to compare and a bar chart is clearer.

Group small categories into an "Other" slice and order slices from largest to smallest in your code to make the chart easier to read.

Frequently Asked Questions

How do I make a pie chart in Mermaid?↓

Write pie title Your title, then lines like "Label" : 42. Each line becomes a slice and the percentages are calculated automatically.

Do the values need to add up to 100?↓

No. Enter raw counts or amounts and Mermaid converts them to proportions. Values must be positive.

How do I show the values on the chart?↓

Write pie showData on the first line to include the raw values in the legend.

Will this diagram render on GitHub, GitLab or Notion?↓

Yes, all three render Mermaid. On GitHub and GitLab, put the code in a fenced code block that starts with ```mermaid. In Notion, add a code block and set its language to Mermaid. Hosted platforms may run an older Mermaid version, so very new syntax can fail there.

How do I export the diagram as PNG or SVG?↓

Use the export buttons above the preview. SVG stays sharp at any size and suits docs and slides; PNG is a raster image that works anywhere images are accepted. Both are created in your browser.

How does sharing work, and is my diagram private?↓

The share link stores your diagram code in the URL hash, the part after #, which browsers do not send to servers. Nothing is uploaded, and your work is autosaved in your own browser. Anyone with the link can see the diagram, so share it only with people you trust.

Last updated: