What this calculator does
A pixel circle generator works out which grid squares to fill so a block-by-block shape reads as a circle, the way it needs to for pixel art, sprite work, or building a round shape out of blocks in a game. Because a circle has no straight edges, every diameter needs its own row-by-row pattern worked out from scratch, which is fiddly to do by hand once the circle gets much bigger than a handful of pixels.
This pixel circle calculator takes a diameter and returns the filled width of every row, from top to bottom, along with the total pixel count. The method is a distance-from-centre test: for each row, it measures how far that row sits from the middle of the circle and works out how many pixels across the circle reaches at that height, the same logic behind the standard midpoint circle algorithm used in graphics programming.
The formula
For row i, counting down from the top, the row's distance from the vertical centre is worked out, then Pythagoras gives the horizontal reach of the circle at that height: half-width = √(r² − dy²), where r is the radius (diameter ÷ 2). Doubling and rounding that half-width gives the number of pixels to fill in that row, centred on the row. Rows outside the circle (where the value under the square root goes negative) are left empty.
| Term | Meaning |
|---|---|
| Diameter | The full width of the circle in pixels, edge to edge. |
| Radius (r) | Half the diameter, the distance from the centre to the edge. |
| dy | How far a given row sits above or below the vertical centre of the circle. |
The inputs explained
| Field | What to enter |
|---|---|
| Circle diameter (px) | The circle's diameter in pixels. Whole numbers work best, since pixel grids do not have fractional squares. |
When to use it
Drawing a circle in a block-building game
Games built on a fixed grid, such as block-placement or voxel games, need an exact list of which squares to place to approximate a circle of a chosen size, rather than a smooth curve the engine cannot render.
Pixel art and sprite design
A pixel artist working at a small canvas size benefits from a reliable, symmetric starting pattern for a circular shape, which can then be touched up by eye rather than guessed from scratch.
Laying out a circular pattern in a physical grid
The same row-width logic applies to anything arranged on a square grid that needs to approximate a circle, such as a mosaic, a stitched pattern, or an LED matrix display.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How the pixel count changes as the circle diameter grows
The total filled pixels and the fill rate against the surrounding square, across a range of diameters.
| Diameter | Total pixels filled | Fill vs bounding square |
|---|---|---|
| 8 px | 50 | 78.1% |
| 12 px | 116 | 80.6% |
| 16 px | 202 | 78.9% |
| 20 px | 316 | 79.0% |
| 30 px | 710 | 78.9% |
| 40 px | 1,258 | 78.6% |
Questions
Why is the pixel count not exactly πr²?
The formula πr² gives a continuous, smooth-edged area. A pixel circle is built from whole square pixels snapped to a grid, so rounding each row's width up or down to the nearest whole pixel makes the total drift slightly from the smooth-circle figure, more so at small diameters where each row is a bigger share of the total.
Does this work for Minecraft-style builds?
Yes. The row-width pattern this calculator produces is the same shape used for circular builds in block-based games: each row width tells you how many blocks to place, centred on that row, working from the top of the circle to the bottom.
Why do some rows have the same width as the row next to them?
Near the top and bottom of the circle the curve is nearly flat, so several consecutive rows round to the same pixel width. Near the middle, where the curve is steepest, the width tends to change by a pixel or two from one row to the next.
Can I generate an oval instead of a circle?
Not with this calculator, which assumes equal width and height. An oval needs two separate radii (horizontal and vertical) in the distance test, which changes the formula rather than just the input.
For the exact geometric area a circle of a given size covers, rather than its pixel approximation, see the area of a circle calculator. For another grid-based building calculation, see the Nether portal calculator.