Voronoi Diagram Calculator
Use this Voronoi Diagram Calculator to enter values, adjust options, and review results in a compact responsive workspace.
Results are calculated automatically as you enter data.
Keyboard: A, Enter, or Space adds a site; Up/Down selects a site; Left/Right moves it; Ctrl+Up/Down moves it vertically; Home/End selects the first or last site; Delete or Backspace removes it. Shift+Arrow moves 10 logical pixels.
▼ See explanations and tips below ▼
Related Calculators
What Is a Voronoi Diagram?
A Voronoi diagram is a way to divide a flat space into regions around a set of points. Each point is called a site. Every location inside a site's region is closer to that site than to any other site.
This idea is useful whenever the main question is, "Which point is nearest?" For example, if several service centers, stores, sensors, cell towers, or sample points are placed on a map-like surface, a Voronoi diagram shows the area naturally associated with each one under a chosen distance rule.
In this calculator, the space is a fixed (900\times560) logical-pixel rectangle. The display scales responsively without changing the geometry, so the same sites produce the same measurements on desktop and mobile. Distances remain screen-space values rather than real-world map measurements.
Why Voronoi Diagrams Matter
Voronoi diagrams turn a set of separate points into a readable spatial pattern. Instead of only seeing where the points are, you can see how much territory each point controls, which points are adjacent, and where the boundaries of equal distance fall.
They are commonly used to explain ideas in:
- Geometry and computational geometry: partitioning a plane into nearest-site regions.
- Data visualization: showing local influence or coverage areas.
- Planning examples: exploring service areas for facilities, sensors, towers, or sample locations.
- Teaching: connecting distance, perpendicular bisectors, polygon area, and adjacency in one visual model.
The most important benefit is that a Voronoi diagram makes nearest-neighbor relationships visible. A large cell suggests that a site is relatively isolated within the current boundary, while a small cell suggests that nearby sites are competing for the same space.
Key Terms to Know
- Site: One of the input points used to build the diagram.
- Voronoi cell: The region closer to one site than to any other site.
- Voronoi edge: A boundary where points are equally close to two neighboring sites.
- Voronoi vertex: A point where three or more Voronoi edges meet.
- Euclidean distance: Straight-line distance between two points.
- Perpendicular bisector: A line that cuts the segment between two sites at a right angle and at its midpoint.
- Delaunay edge: An edge in a triangulation satisfying the empty-circumcircle condition. For nondegenerate sites, it connects sites whose Voronoi cells share an edge.
- Nearest neighbor: The closest other site to a given site.
- Cell area: The amount of canvas covered by a Voronoi cell.
- Cell perimeter: The total length around the boundary of a clipped Voronoi cell.
How Voronoi Diagrams Work
The rule behind a Voronoi diagram is simple: for every location on the canvas, find the nearest site. All locations nearest to the same site become that site's cell.
For a point \(p=(x,y)\) and a site \(s_i=(x_i,y_i)\), the straight-line distance is:
The Voronoi cell for site \(s_i\) is the set of all points closer to \(s_i\) than to any other site:
Between two sites, the boundary is a perpendicular bisector. Every point on that boundary is the same distance from both sites. On one side of the boundary, points are closer to the first site; on the other side, they are closer to the second site.
For two sites \(a=(a_x,a_y)\) and \(b=(b_x,b_y)\), the half-plane closer to \(a\) can be written as:
A finite cell can be built by starting with the canvas rectangle and repeatedly clipping it against the half-plane closer to the current site than to each other site. After this process, the remaining polygon is that site's clipped Voronoi cell.
Measuring Cell Area and Perimeter
Once a cell is a polygon, its area can be measured from its vertices. For a polygon with ordered vertices \((x_1,y_1),(x_2,y_2),\ldots,(x_n,y_n)\), the shoelace formula is:
where the final vertex wraps around so that \((x_{n+1},y_{n+1})=(x_1,y_1)\).
The perimeter is the sum of the side lengths:
In this calculator, the cells are clipped to the visible rectangular canvas, so area is measured only inside that rectangle.
Voronoi and Delaunay Connections
The Delaunay overlay is closely related to the Voronoi diagram. In a standard point-site Voronoi diagram, neighboring Voronoi cells correspond to connected sites in the Delaunay structure.
A useful way to remember the difference is:
- Nearest-neighbor links answer: "Which site is closest to this site?"
- Delaunay edges answer: "Which sites are connected in a valid empty-circle triangulation?"
A nearest-neighbor link does not have to be the same thing as a Delaunay edge. A site may share a cell boundary with another site even if that neighbor is not its single closest site.
Examples of Voronoi Diagrams in Practice
Example 1: Two Points on a Horizontal Line
Suppose there are two sites on the canvas:
- \(A=(100,200)\)
- \(B=(300,200)\)
The midpoint between them is:
Because the segment from \(A\) to \(B\) is horizontal, the perpendicular bisector is the vertical line through the midpoint:
Every point to the left of \(x=200\) is closer to \(A\). Every point to the right of \(x=200\) is closer to \(B\). Points exactly on \(x=200\) are equally distant from both sites.
Example 2: Facilities on a Canvas
Imagine placing several facility points on the canvas. A Voronoi cell around one facility represents the part of the canvas closer to that facility than to any other facility.
A large cell may mean the facility is far from its neighbors or near an open part of the canvas. A small cell may mean nearby facilities are competing for the same area. If two facility cells share a boundary, the Delaunay overlay can connect them as neighboring sites.
This is useful for teaching coverage and adjacency, but the result should not be treated as a real travel-time model. The calculator uses straight-line pixel distance, not roads, obstacles, elevation, or travel speed.
Example 3: A Tie on a Boundary
Suppose a point on the canvas is exactly the same distance from two sites. That point lies on a Voronoi edge.
For example, with \(A=(0,0)\) and \(B=(4,0)\), the point \(p=(2,3)\) is equally distant from both:
That tie is not an error. It is exactly what a Voronoi boundary represents. When nearest-neighbor distances tie within the calculator's tolerance, the nearest-site table can show multiple nearest sites.
How to Interpret the Result
A Voronoi cell shows the part of the current canvas that belongs to one site under straight-line distance. If a location is inside a cell, it is closer to that cell's site than to any other site.
The result summary and tables should be read in this way:
- Sites: The number of active points in the diagram.
- Delaunay edges: The number of edges in the deterministic triangulation computed from the current normalized site coordinates.
- Average cell area: The mean area of all clipped cells inside the canvas.
- Shortest neighbor: The smallest nearest-neighbor distance among all sites.
- Nearest-site table: For each point, the closest other point or tied closest points.
- Cell measurement table: Cell area and perimeter, sorted from largest to smallest area.
Cell area can be displayed as either square pixels or as a percentage of the canvas. The percentage version is:
A larger percentage means the cell covers a larger share of the current canvas. It does not mean the site is more important; it only means more of the canvas is closest to that site under the calculator's distance rule.
Nearest-neighbor distances are measured in logical pixels. A value such as \(42.5\text{ px}\) means the two sites are 42.5 units apart in the fixed calculator coordinate system, not 42.5 meters, miles, or any other real-world unit.
Common Mistakes and Misconceptions
Treating pixels as real-world distances. Pixel distances only become real-world distances if a valid scale is supplied. This calculator does not apply map scale, geographic coordinates, or projections.
Assuming cells extend forever. In pure geometry, outer Voronoi cells can be unbounded. Here, every cell is clipped to the visible rectangular canvas, so the measured cell area is the area inside the canvas only.
Confusing Delaunay edges with nearest-neighbor links. Nearest-neighbor links show closest-point relationships. Delaunay edges show cell adjacency. They often overlap, but they are not the same question.
Rounding too early. Displayed values are rounded for readability. For example, percent area is shown to one decimal place, and pixel area can be shown as a whole number. Small differences may be hidden by rounding.
Expecting the canvas to be the only input. You can click, drag, select, and remove sites on the canvas, or enter finite X/Y logical-pixel coordinates in the Add a site by coordinate fields. The canvas also supports keyboard add, Up/Down selection, Left/Right one-pixel or ten-pixel movement, and Delete/Backspace removal.
Expecting unlimited points. Manual point placement is limited to 50 sites. Random generation is limited to a smaller range so the diagram stays readable.
Using points that are too close together. Very close or overlapping sites make geometric comparisons unstable and hard to see. The calculator rejects sites that are too close to an existing site.
When to Use Voronoi Diagrams
Use a Voronoi diagram when you want to explore questions such as:
- Which site is closest to each location in a flat space?
- How does moving one site change nearby regions?
- Which sites have adjacent influence areas?
- Which site has the largest or smallest clipped coverage region?
- Where do equal-distance boundaries occur?
- How do clusters, gaps, and isolated points affect spatial coverage?
Voronoi diagrams are especially useful for learning and visual exploration because small changes in point placement create immediate changes in the cell pattern.
Limitations and Things to Keep in Mind
This calculator uses a planar Euclidean model. That means it assumes a flat rectangular canvas and straight-line distance between points.
Important limitations include:
- Measurements are in fixed logical pixels, not real-world units.
- Cells are clipped to the fixed (900\times560) logical rectangle.
- The calculator does not support weighted sites.
- It does not support road distance, travel time, barriers, elevation, or map projections.
- It does not support 3D Voronoi diagrams.
- It does not use custom boundary shapes.
- It supports typed X/Y logical-pixel coordinate input and keyboard editing, but not custom point names.
- The Delaunay overlay uses a deterministic empty-circle triangulation over normalized site coordinates. Candidate circumcircles are tested for empty interiors, edges are canonicalized by source index with input-order triple scanning, crossings are resolved repeatably, collinear sites use a source-index-stable neighbor chain, and cocircular ties receive a repeatable valid diagonal choice.
- Browser canvas support is required for rendering and image export.
- Coincident sites are rejected because they do not have uniquely attributable Voronoi cells. Random sites are generated with a minimum separation.
For teaching, visualization, and exploratory geometry, these assumptions are usually helpful because they keep the diagram easy to understand. For engineering, mapping, logistics, scientific modeling, or official planning, use a tool that supports the correct coordinate system, distance model, scale, boundary data, and validation requirements.
How to Use This Calculator
- Choose a preset such as facilities, cells, map, or clusters, or keep the default preset.
- Click the canvas to add a site, or enter X/Y logical-pixel coordinates and choose Add site.
- Drag an existing site to move it, or focus the canvas and use A/Enter/Space to add, Up/Down or Home/End to select, Left/Right to move, and Shift+Left/Right to move 10 logical pixels.
- Remove a selected site with Delete or Backspace, or remove a site by right-clicking or Alt-clicking it.
- Use the display toggles to show or hide Voronoi cells, Delaunay edges, nearest-neighbor links, and point labels.
- Enter a random point count and use the random action to generate a new point set.
- Choose whether cell areas should appear as percentages or as square pixels.
- Read the summary, metrics, nearest-site table, and cell measurement table.
- Use the download action to save the current diagram as a PNG image.
Frequently Asked Questions
What does each Voronoi cell mean?
Each cell contains the part of the canvas closer to its site than to any other site. If you place a new point anywhere inside that cell, the cell's site would be the nearest site under straight-line pixel distance.
Why are some Voronoi cells larger than others?
A larger cell usually means the site has more open space around it inside the current canvas. A smaller cell usually means nearby sites are limiting how far that site's region can extend.
Are Voronoi cell areas exact?
The cells are computed with floating-point arithmetic and checked by summing their areas and testing their nearest-site half-plane constraints. Displayed values are then rounded for readability: percentages to one decimal place, square-pixel areas to whole numbers, and distances and perimeters to one decimal place.
What is the difference between Delaunay edges and nearest-neighbor links?
A nearest-neighbor link connects a site to its closest other site. A Delaunay edge connects sites whose Voronoi cells share a boundary. These relationships often overlap, but one describes closeness while the other describes region adjacency.
Why does the calculator show pixel units instead of meters or miles?
The diagram is drawn on a canvas, so its native measurement unit is the pixel. To convert pixels into real-world units, you would need a reliable map scale or coordinate system, which this calculator does not apply.
What happens with only one point?
With one site, the entire canvas belongs to that site. Nearest-neighbor distance and Delaunay-style comparisons are not meaningful until at least two sites are present.
Can two sites have the same nearest neighbor distance?
Yes. Ties can occur when a site is equally close to two or more other sites. In that case, the nearest-site table can show multiple nearest sites.
Does a Voronoi diagram work with geographic maps?
The concept can be adapted to geographic work, but this calculator does not perform geographic calculations. Real map analysis may need coordinate reference systems, projections, geodesic distances, road networks, travel times, barriers, or weighted service areas.
Sources and References
Books
- Mark de Berg, Otfried Cheong, Marc van Kreveld, and Mark Overmars. Computational Geometry: Algorithms and Applications. 3rd ed., Springer Berlin Heidelberg, 2008. Relevant chapters: "Voronoi Diagrams," pp. 147–171, and "Delaunay Triangulations," pp. 191–218. Springer book page
- Joseph O'Rourke. Computational Geometry in C. 2nd ed., Cambridge University Press, 1998. Relevant chapter: "Voronoi Diagrams," pp. 155–192. Cambridge Core chapter page
Online and Official Sources
- CGAL. "2D Voronoi Diagram Adaptor: User Manual." CGAL 6.2 documentation, accessed July 4, 2026. https://doc.cgal.org/latest/Voronoidiagram2/index.html
- Eric W. Weisstein. "Voronoi Diagram." MathWorld—A Wolfram Resource, accessed July 4, 2026. https://mathworld.wolfram.com/VoronoiDiagram.html
- Centre for Education in Mathematics and Computing, University of Waterloo. "The Shoelace Formula." CEMC Open Courseware, accessed July 4, 2026. https://courseware.cemc.uwaterloo.ca/42/143/assignments/1140/0