StatGardenREF. DESK
Calculators/Geometry/Pixel Circle Generator
Geometry

Pixel Circle Generator calculator

Which grid squares to fill to draw a circle of a given pixel diameter, row by row.

Published 21 August 2026

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

FormulaFor row i (0-indexed from the top), dy = (i + 0.5) − r; filled half-width = √(r² − dy²) when positive, where r = diameter / 2

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.

TermMeaning
DiameterThe full width of the circle in pixels, edge to edge.
Radius (r)Half the diameter, the distance from the centre to the edge.
dyHow far a given row sits above or below the vertical centre of the circle.

The inputs explained

FieldWhat 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.

Total pixels filled by diameter
DiameterTotal pixels filledFill vs bounding square
8 px5078.1%
12 px11680.6%
16 px20278.9%
20 px31679.0%
30 px71078.9%
40 px1,25878.6%
The filled share of the bounding square stays close to π/4 (about 78.5%) at every size, since that is the geometric ratio between a circle's area and the square that contains it; larger diameters bring the rounded result closer to that theoretical figure.

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.