Flamegraph Generator
Turn folded stack samples into an interactive SVG flamegraph with zoom, search and offline export.
Folded stacks
One sample per line: frame;frame;leaf count. Missing counts default to 1. Up to 5 million characters.
Flamegraph
Paste folded stacks to draw a flamegraph
Try the profile sample, or use the download for an offline-interactive SVG.
Details
A flamegraph shows where time goes: every rectangle is a stack frame and its width is the share of samples in which that frame appears. Paste the folded format used by stackcollapse-perf.pl, async-profiler and pprof — one stack per line, frames separated by semicolons, followed by a sample count. The tool builds a prefix tree, aggregates duplicate paths and draws the result immediately. Click any rectangle to zoom into its subtree, search a frame name to see matching coverage, flip to reverse orientation and download a standalone SVG that keeps its hover and click behavior when opened offline. Counts are optional (they default to 1), fractional counts are rounded and invalid lines are reported. All processing happens in the tab; the exported SVG embeds your samples, so handle it like any other profile artifact.
More examples
From perf
perf script | stackcollapse-perf.pl > folded.txt
main;parse;tokenize 4
main;render;layout 5Paste the folded file's contents; the generator takes it from there.
Click to zoom
main;render;layout;paint 2
main;render;layout;measure 5
→ click 'render' → breadcrumb: (root) › main › renderZoom re-roots the graph so the selected subtree fills the full width.
Search coverage
search: malloc
→ 12.4% coverage across 3 matching framesMatching frames are highlighted magenta and only top-most matches count once toward coverage.
Offline SVG
Download SVG → open locally → hover and click still workThe export embeds its data and script, with no external CSS or network dependency.
Examples
Zoom into a hot frame
main;render;layout 5
main;render;paint 2click 'render' → subtree fills the canvasZoom re-roots at the selected frame while preserving the ratios beneath it.
Search coverage
search: layoutmatching frames highlighted magenta · coverage shown as %Only top-most matches contribute once to coverage, avoiding double counting.
Unfolded paste
perf event 12
other event 8warning: input looks unfoldedA flat count table still renders but the tool tells you how to fold real profiler output.
About this tool
Flamegraph Generator turns folded stack samples into an interactive flamegraph without a Perl pipeline. Paste lines in the `frame;frame count` format used by perf, async-profiler and pprof; the browser aggregates identical paths into a prefix tree and draws a rectangle for every frame.
Rectangle width is the share of total samples, so wide platforms are the hot paths. Click a frame to zoom into its subtree, search a name to highlight matches and see coverage, flip orientation, and download a standalone SVG that remains interactive offline.
Counts are tolerant: missing counts become 1, fractional counts round, and invalid lines are reported instead of silently corrupting totals. Everything runs in the tab; the exported SVG embeds your data, so treat it like any other profile artifact.
What this tool does not do
- Folded stacks have no time axis; drag-select time-span zoom is not meaningful here.
- Differential (red/blue) flamegraphs are not supported in this version.
- The standalone SVG's click-to-zoom works when opened directly as a file, not when embedded as an HTML image.
- Input is capped at 5 million characters to keep the tab responsive.
How to use this tool
Fold your profile
For perf, run perf script | stackcollapse-perf.pl; for Java or Go tools, export their folded-stack format.
Paste or load an example
One sample per line, frames separated by semicolons and an optional trailing count.
Explore the graph
Click a rectangle to zoom, use the breadcrumb to return and search frame names to highlight matching paths.
Download the SVG
Save a self-contained file with embedded data and script for a postmortem or incident doc.
Use cases
Incident postmortems
Attach a self-contained interactive SVG to the doc without a local toolchain.
Perf triage
Find the widest cumulative path and zoom into the frames that matter.
Teaching profiling
Show how self time and cumulative time differ by hovering frames.
Folded stack input
| Line | Meaning |
|---|---|
| main;parse;tokenize 4 | Three frames, 4 samples |
| main;render 3 | Missing deeper frames |
| alloc | No trailing count |
| main; 0 | Empty or zero stack |
Duplicate paths aggregate into the same tree node; sub-pixel rectangles are hidden with a visible count.
Common mistakes
Mistake:Pasting raw `perf script` output.
Fix:Fold it first with stackcollapse-perf.pl; the tool detects and warns about unfolded input.
Mistake:Reading width as self time.
Fix:Rectangle width is cumulative samples; hover for both cumulative and self counts.
Mistake:Ignoring hidden sub-pixel frames.
Fix:Check the hidden-frame count and zoom in before concluding a path is cold.
Mistake:Sharing a downloaded SVG publicly.
Fix:It embeds your frame names and sample counts — review it before publishing.
Frequently asked questions
What input format does this accept?
The folded format: one line per sample, frames separated by semicolons from root to leaf, with a trailing count. For example `main;parse;tokenize 4`. perf, async-profiler and pprof tools can all export it.
How do I fold perf output?
Run `perf record -g` and then `perf script | stackcollapse-perf.pl > folded.txt`. Paste the resulting lines here. A line without a count is treated as one sample, but folding gives accurate weights.
What does rectangle width mean?
Width is cumulative: the fraction of total samples whose stack contains that frame. Self time is the part attributed to the frame itself and appears when you hover. Depth is the call-chain level.
Does the downloaded SVG stay interactive offline?
Yes. The export embeds its data and script, so hovering, click-to-zoom and the breadcrumb work when you open the SVG directly in a browser. Embedding it with an HTML `<img>` tag disables scripts by browser design.
Why are some frames missing?
Rectangles narrower than one pixel are pruned to keep the graph responsive; the tool shows how many were hidden. Zoom into a hot frame to bring its children back into view.
Is my profile data uploaded?
No. Parsing, aggregation and rendering happen entirely in your browser tab. The downloaded SVG contains your frame names and counts, so review it before sharing outside your team.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.