# Tupper's Self-Referential Formula: Math That Draws Itself

*Science & Technology · Priya Nair · 2026-08-01*

## TL;DR

Tupper's self-referential formula, created by Jeff Tupper in 2001, is a single mathematical inequality that plots a graph of itself when rendered in a specific pixel region. The formula uses a massive constant and binary bitmap encoding to draw any image, and its self-portrait became a viral math icon.

## Key facts

- The formula was introduced by Jeff Tupper in a 2001 paper on reliable graphing methods.
- It plots its own graph within a specific coordinate range using a 1061-digit constant.
- The formula works by encoding a 17-pixel-tall bitmap into a binary number, multiplied by a scaling factor.
- Tupper's self-referential formula can render any 106x17 pixel image, not just its own portrait.
- The formula gained widespread attention online as a programming and math challenge, spawning interactive playgrounds.

## The Formula That Draws Itself: Meet Tupper's Self-Referential Formula

In 2001, Canadian mathematician Jeff Tupper introduced something that sounds like a magic trick dressed in math robes: a formula that, when plotted on a graph, draws a pixelated image of itself. Tupper's Self-Referential Formula doesn't just calculate numbers. It looks back at you from the page, rendered in tiny black squares, showing you the very equation you're staring at.

At first glance, the formula is a jumble of symbols, floor brackets, modular arithmetic, and variables that seem to sprawl in every direction. It looks chaotic, almost like someone spilled a chalkboard. But here's the payoff: when you feed it the right value of *n*, a single massive integer, and plot the result across a 106-by-17 grid of pixels, the image that emerges is the formula itself. The math doesn't just describe a shape. It describes its own face.

The trick works because the formula treats the graph like a bitmap. Each pixel in that 17-unit-high strip corresponds to one bit in the binary expansion of *n*. A truth test, written as `0.5 < mod(...)`, decides whether each square gets filled in black or stays white. Change *n*, and you change the picture. In fact, any 106-by-17 black-and-white image you can dream up has some integer *n* that will produce it. The formula is a universal sketchpad, and its own portrait is just one of the infinite drawings hidden inside a very long number.

## How Does Tupper's Formula Work? A Bitmap in Disguise

Tupper's Self-Referential Formula is, at its core, a cleverly disguised bitmap system that reads binary numbers like a painter reads a grid of pixels. When Canadian mathematician Jeff Tupper introduced it in 2001, he wasn't just sharing another equation; he was handing us a universal key that could theoretically draw any black-and-white image imaginable. The formula takes three variables: *x* and *y*, which represent pixel coordinates on a graph, and *n*, a massive constant number that acts as the encoded image itself.

Picture a 106-column grid that stands 17 units tall. The variable *y* divides this space into 17-unit sections, while *x* moves horizontally across each column. The secret to the whole operation lives inside *n*, which is written as a long binary string like 110101001... Each individual bit in that string corresponds to one specific pixel's color. The formula runs a truth test on every coordinate: if the inequality holds true with the modular arithmetic check (0.5 < mod), that pixel gets filled in black. If it fails, the pixel stays white.

What makes this so remarkable is the flexibility hiding inside that fixed 17-unit matrix. Every possible arrangement of black and white squares in that grid corresponds to some integer value of *n*. Change the number, and you change the picture entirely. A heart, a signature, a portrait, even the formula itself rendered as an image: each one is just a different long string of ones and zeros waiting to be decoded. The formula doesn't draw by itself; it reveals whatever image you've already hidden inside the number.

## Can Tupper's Formula Draw Anything? Yes, Even a Heart

The short answer is yes: Tupper's Self-Referential Formula can theoretically draw any finite black-and-white image you can imagine, and all it takes is finding the right number. Because every picture is just a grid of pixels, and every grid pattern corresponds to some specific integer, the formula becomes a universal drawing machine. A heart, a portrait, a signature, all of them are waiting inside some large number.

Think of it this way. Every image you see on a screen is really a bit-map, a collection of tiny squares that are either filled or empty. That binary pattern, a long string of ones and zeros, is itself just a number when you read it as a sequence of bits. The trick of Tupper's Self-Referential Formula is that it reads that number back out, decoding it into a visible picture on a grid that is 106 pixels wide and 17 pixels tall.

So to draw a heart, you would start by mapping your heart shape onto that 106 by 17 grid. Each square gets a 1 if it is part of the heart and a 0 if it is not. Reading those bits in the right order gives you a single enormous integer, call it n. Plug that n into the formula, run the truth test that decides whether each pixel is black or white, and the heart appears. The same process works for literally any other shape you can fit on that grid.

You do not have to do the arithmetic by hand. Interactive tools exist exactly for this purpose, and one of the most popular is the Tupper's Self-Referential Formula Playground, an online page where you can load a preset, tweak the value of n, and watch the graph redraw itself instantly. It makes the whole idea feel almost like magic, even though the math behind it is completely solid. Every picture is a number, and the formula is the key that unlocks it.

## Why This Matters: Math as Art

Here is the quiet miracle hiding inside Tupper's Self-Referential Formula: every image you have ever seen, every sketch, every logo, every doodle, can be compressed into a single, enormous integer. That thought lands somewhere between a magic trick and a philosophical bombshell. It suggests that the boundary between the cold world of numbers and the warm world of pictures is not a wall at all, but a thin, permeable membrane.

Consider what that means when you stare at the formula's own graph, rendered in pixelated black and white on a 106-by-17 grid. The squiggly symbols you see are not just describing something abstract; they are describing themselves, folded into the digits of a number so large it defies everyday intuition. The aesthetic pleasure comes from recognizing that a jumble of mathematical notation, something that looks like a random string of characters, can hold a mirror up to its own face. There is a strange, almost poetic satisfaction in that self-awareness.

And that is the deeper point the original account wants to leave you with. Mathematics, at its core, is not merely a tool for engineers or a hurdle for students. It is a creative force, a language of pattern and structure that underlies everything we see and build. When you realize that a single number can encode a heart, a face, or a formula's own portrait, you start to glimpse the artistry baked into the universe's operating system. The numbers were always there, waiting for someone like Canadian mathematician Jeff Tupper to come along in 2001 and show us how to look at them differently.


## Frequently asked questions

**What is Tupper's self-referential formula?**

Tupper's self-referential formula is a mathematical inequality created by Canadian mathematician Jeff Tupper in 2001 that, when graphed with a specific constant, displays a pixelated image of itself. It was introduced in a paper presented at the SIGGRAPH 2001 conference on computer graphics and interactive techniques.

**Who discovered Tupper's self-referential formula?**

Jeff Tupper, a Canadian mathematician, first introduced the formula in 2001 at the SIGGRAPH conference, an annual gathering focused on computer graphics and interactive techniques. The formula appeared in his paper on reliable two-dimensional graphing methods for mathematical formulae with two free variables.

**How does Tupper's self-referential formula work?**

The formula operates like a bitmap system using binary numbers. It evaluates points on an (x, y) coordinate plane, where the constant n encodes the image as a long binary sequence. The inequality applies a truth test using modular arithmetic and a floor function to determine whether each pixel renders black or white. The formula decodes the bits of n within a matrix that stands 17 units high. The y-axis divides into 17-unit strips, each corresponding to a portion of n, while the x-axis determines pixel colors column by column. A pixel turns black when the truth test, which uses the condition 0.5 < mod, returns true; otherwise, it stays white.

**Can Tupper's self-referential formula draw any image?**

Yes, the formula can theoretically draw any finite black-and-white image. Every possible shape corresponds to some integer value of n, because each image is essentially a specific combination of bits in a bitmap. By calculating the correct n for a desired pattern, such as a heart shape, you can reproduce that image through the formula.

**Why is Tupper's self-referential formula called self-referential?**

The formula earns its name because, for one particular value of n, the graph it produces displays the formula itself. When you plot the inequality with that specific constant, the resulting pixelated image shows the very equation you started with, creating a mathematical mirror that reflects its own definition.

**Where can I try Tupper's self-referential formula?**

You can experiment with the formula using online playgrounds designed for this purpose. One such tool, the Tupper's Self-Referential Formula Playground, lets you input different values of n and watch the corresponding image render on screen, making it easy to test how changing the constant alters the final picture.

Canonical: https://curio.madeda.com/tuppers-self-referential-formula-math/
