Foundations

By the Graphiti team · Aug 5, 2026 · 6 min read

What Is a Mathgram? The Math Behind Every Doodle

Every shape you draw already has an equation. A mathgram is just proof of it.

A mathgram is the shareable card Graphiti makes after it fits your hand-drawn shape to a real equation — the drawing on one side, the formula that matches it on the other, plus a score for how close the match actually is. You draw a loop, a wave, a spiral, whatever. The app finds the equation. The mathgram is the receipt.

That's the whole idea in one sentence. The rest of this post is about why that's a more interesting sentence than it first sounds.

What actually happens between your drawing and the card

When you draw on the canvas, Graphiti isn't storing a picture of your line — it's recording it as a set of coordinates, the same way a graph in a math class plots points on an x- and y-axis. Once you lift your finger, the app runs those coordinates through a symbolic regression engine, which searches for an equation whose curve passes as close as possible to the points you drew.

That search is a form of curve fitting, but a more ambitious kind: instead of assuming you drew, say, a parabola and just solving for its numbers, the engine also has to figure out what kind of curve you drew in the first place — a line, a circle, a spiral, something wavy, or some combination. Once it lands on its best guess, it hands back an equation and a fit score, and that pairing becomes the mathgram.

What's actually on a mathgram card

Every card carries the same handful of honest pieces of information:

Nothing on the card is decorative. Every element is there because it's part of how the answer was reached — which is the actual point of calling it something other than just an "export" or a "share image."

Why turn a doodle into an equation at all

Because it's a genuinely strange and satisfying thing to watch happen. Most of us stopped thinking about equations the day we stopped being tested on them, and most of us also draw circles, hearts, and spirals constantly without ever connecting them back to that math class. A mathgram is the collision of those two things: the doodle you'd make anyway, and proof that it was never just a doodle — it was a shape with a formula the whole time, and now you can see it.

It also happens to be verifiable in a way a lot of internet content isn't. Anyone can screenshot a shape and caption it "math is wild." A mathgram shows the actual equation and how well it fits, which means it's a claim someone else could check, not just vibes with a font on top.

The doodle isn't the input to a magic trick. It's data. The mathgram is what that data looks like once someone actually does the math on it.

A mathgram vs. a screenshot

A screenshot of a drawing is a picture of a picture. A mathgram is a picture plus a claim — "this curve fits this shape to within this much error" — and the claim is sitting right there in the typeset equation and the fit score, not hidden in a caption you have to trust. That's a small difference in format and a real difference in what you're actually sharing.

Where to go from here

If you want the mechanics behind the fit score, start with how curve fitting actually works. If you want to know why the engine can recognize a spiral instead of just forcing everything into a straight line, read symbolic regression, explained for actual humans. And if you're curious why we picked the word "mathgram" specifically, that one's got its own post: why we called it a mathgram.

Or skip the reading and see what the cards actually look like in the gallery, or get the full rundown on how it works.