Circle Packing Generator
Fill a shape with circles that never overlap. The tool drops circles one at a time at seeded random points inside a rectangle, a circle, a hexagon or a triangle, and keeps each one only if it stays at least the gap you choose from every other circle and from the edge. Random sizes take the largest circle that fits at each point, up to a maximum, so big circles come first and small ones fill the spaces; size range picks a radius at random between your smallest and largest; equal makes every circle the same. It reports how many circles it placed and how much of the shape they cover. It prints at real size, filling the page or at the width and height you type. Download a PDF, a 300 DPI PNG or an SVG with every circle as a circle element, ready for laser cutters and plotters. Nothing is uploaded.
100% private — everything runs in your browser. Everything runs in your browser; nothing is uploaded.
Print at 100% (Actual size): the design prints at real size. The SVG holds every circle as a circle element, ready for cutters.
Circles
Look
Size
Page
Runs in your browser with our own code: nothing you type is uploaded or saved. Every circle is placed and checked by our own code. You may use what you make here, including commercially, with no credit needed.
How to make and print a circle packing
- Pick a preset, or choose the shape.
- Choose random sizes, a size range or equal circles, and the radii.
- Set the gap, the most circles, the number of tries and the seed.
- Choose filled, outlines or both, the colour rule and the colours.
- Choose fill the page or a width and height.
- Download the PDF and print at 100% (Actual size), or the PNG or SVG.
What you can use it for
- Laser-cut and CNC panels, screens and coasters
- Posters, prints and backgrounds
- Dot and bubble patterns for packaging and textiles
- Planning holes, studs or tiles with a set gap
- Maths and art lessons on packing and coverage
- Vinyl and plotter art from the SVG circles
The 14 presets
| Preset | Shape | Sizes | Radius | Gap | Circles | Coverage | Closest pair (edge to edge) | Closest to the edge |
|---|---|---|---|---|---|---|---|---|
| Square, random sizes 2 to 20 mm | rectangle | random (largest that fits) | 2 mm to 20 mm | 1 mm | 235 | 67.0 % | 1 mm | 1 mm |
| Full page, random sizes 1.5 to 25 mm | rectangle | random (largest that fits) | 1.5 mm to 25 mm | 1 mm | 422 | 69.8 % | 1 mm | 1 mm |
| Circle, random sizes 1.5 to 18 mm | circle | random (largest that fits) | 1.5 mm to 18 mm | 0.8 mm | 298 | 69.9 % | 0.8 mm | 0.8 mm |
| Hexagon, random sizes | hexagon | random (largest that fits) | 1.5 mm to 16 mm | 0.8 mm | 264 | 68.8 % | 0.8 mm | 0.8 mm |
| Triangle, random sizes | triangle | random (largest that fits) | 1.5 mm to 16 mm | 0.8 mm | 186 | 67.3 % | 0.8 mm | 0.8 mm |
| Size range 4 to 12 mm (random pick) | rectangle | size range | 4 mm to 12 mm | 1 mm | 186 | 46.6 % | 1.006 mm | 1.014 mm |
| Equal circles, 6 mm radius | rectangle | equal | 6 mm | 1 mm | 158 | 41.0 % | 1.002 mm | 1.073 mm |
| Laser cut: outlines only, 2 mm gap | rectangle | random (largest that fits) | 3 mm to 15 mm | 2 mm | 63 | 54.8 % | 2 mm | 2 mm |
| No gap: circles may touch | circle | random (largest that fits) | 1 mm to 20 mm | 0 mm | 711 | 84.4 % | 0 mm | 0 mm |
| Many small circles, 0.8 to 5 mm | rectangle | random (largest that fits) | 0.8 mm to 5 mm | 0.4 mm | 2,004 | 64.9 % | 0.4 mm | 0.4 mm |
| Few big circles, 10 to 45 mm | circle | random (largest that fits) | 10 mm to 45 mm | 1.5 mm | 17 | 66.2 % | 1.5 mm | 1.5 mm |
| Square, seed 2 | rectangle | random (largest that fits) | 2 mm to 20 mm | 1 mm | 204 | 70.6 % | 1 mm | 1 mm |
| Real size 5 x 5 in, 0.1 to 0.6 in | rectangle | random (largest that fits) | 0.1 in to 0.6 in | 0.03 in | 113 | 67.0 % | 0.03 in | 0.03 in |
| Polka-style: 200 equal 4 mm circles | rectangle | equal | 4 mm | 3 mm | 200 | 23.1 % | 3.023 mm | 3.55 mm |
Worked out by the tool on US Letter; the last two columns are never below the gap.
Seeds: square, random sizes 2 to 20 mm
| Seed | Circles | Coverage | Largest radius |
|---|---|---|---|
| 1 | 235 | 67.0 % | 20 mm |
| 2 | 204 | 70.6 % | 20 mm |
| 3 | 199 | 70.0 % | 20 mm |
| 4 | 235 | 66.6 % | 20 mm |
| 5 | 200 | 69.2 % | 20 mm |
Tries: square, random sizes 2 to 20 mm
| Tries | Circles | Coverage |
|---|---|---|
| 5,000 | 196 | 64.9 % |
| 20,000 | 225 | 66.5 % |
| 60,000 | 235 | 67.0 % |
| 200,000 | 244 | 67.4 % |
What prints
| Download | What is in it |
|---|---|
| The packing at real size, every circle as a vector curve, with the count, radii, gap, coverage and a check bar | |
| PNG 300 DPI | The same sheet as a picture |
| SVG | Every circle as a circle element, plus the shape outline, at real size |
For a cutter that needs DXF, use SVG to DXF; to edit the outline, the SVG Path Editor.
Which tool to use
| You want | Use |
|---|---|
| Random circles that never overlap, with a gap | Circle Packing Generator (this page) |
| Touching circles by Descartes’ theorem | Apollonian Gasket |
| Equal dots on a repeating grid | Polka Dot Pattern Generator |
| Cells around random points | Voronoi Generator |
Other tools: the Polka Dot Pattern Generator makes seamless dot repeats, and the Voronoi Generator cell patterns.
More free tools
Maths art and printables?
Drawing and print tools that run privately in your browser, with no sign-up and no watermark.
Frequently asked questions
What is circle packing?
Placing circles in a shape so that no two overlap. This page packs circles at random: it is not the densest packing of a given set of circles, and it does not make the circles touch each other (unless the gap is 0).
How does the tool place the circles?
It picks a random point inside the shape (from a seed), works out the room there, which is the distance to the nearest circle and to the edge minus the gap, and keeps a circle if it fits. Random sizes use the largest radius that fits, up to the maximum, and need at least the minimum. Size range picks a radius between the minimum and the maximum and keeps it only if it fits. Equal uses the maximum every time. It stops after the number of tries or when it reaches the most circles you asked for.
Is it checked that circles never overlap?
Yes. Our tests check every pair of circles on every preset: the distance between centres is at least the two radii plus the gap, to 10⁻⁹ mm, and every circle is at least the gap inside the shape. The table below shows the closest pair and the closest circle to the edge for each preset.
What is coverage?
The total area of the circles divided by the area of the shape, worked out by the tool and shown under the options and in the footer. Random sizes, which fill the spaces with smaller and smaller circles, cover much more than equal circles or a size range: compare the Coverage column in the table below.
What do seed and tries change?
The seed sets the random points, so the same settings and seed always give the same picture, and another seed gives a new one. More tries fill more of the gaps, up to the point where no more circles of the smallest size fit.
Can I use it for laser cutting?
Yes. Choose outlines only: the SVG and PDF draw each circle once as a thin line, with no fill. The gap you set is the narrowest bridge left between holes and between a hole and the edge.
Is this the same as the Apollonian gasket?
No. The Apollonian gasket fills a circle with circles that all touch, using Descartes’ circle theorem. This page places circles at random with a gap you choose, in four shapes.
Is it free?
Yes. There is no sign-up, no watermark and no limit.
Is anything uploaded?
No. Every point and circle is worked out by JavaScript in your browser. Nothing you type is sent anywhere or saved when you close the page.