Calculate overlap percentage from an overlap area and a reference area, or compare two ranges to get overlap as a percent of each range and their union.

The area to compare against: area A, area B or their combined area.

Optional settings


Related Calculators

Calculator Functions

FunctionWhat it doesWhat it requires
Overlap area / reference areaFinds what percentage of a reference area is covered by a known overlap areaRequires the overlap area and the reference area, each in mยฒ, cmยฒ, ftยฒ or inยฒ
Two continuous intervalsFinds how much two number ranges overlap, as a percentage of their combined span and of each rangeRequires the start and end of range A and the start and end of range B, all in the same unit

Overlap area / reference area also shows both areas in square meters. Two continuous intervals also shows the overlap length, the length of each range, the union length, and the overlap as a percentage of range A, of range B and of the smaller range. Endpoints entered in reverse order are swapped.

Overlap Percentage Formulas

O = Ao รท Aref ร— 100
OOverlap percentage (%)
AoOverlap area, the region both shapes share
ArefReference area the overlap is compared with

The percentage depends on which area is the reference. The same overlap is a larger share of the smaller shape, a smaller share of the larger shape, and smaller still against the two shapes combined.

Overlap area / reference area

The main formula applies directly, after both areas are converted to square meters. An overlap of 50 mยฒ on a 200 mยฒ reference is 50 รท 200 ร— 100 = 25%. An overlap of 2 ftยฒ on a 1 mยฒ reference is 0.185806 รท 1 ร— 100 = 18.5806%. The reference can be the first area, the second area or their union, and the overlap cannot be larger than it. The overlap itself must already be known, since no shapes are entered.

Two continuous intervals

I = min(Ahi, Bhi) โˆ’
max(Alo, Blo)

I is the shared length, and it counts as zero when the result is negative, which means the ranges do not meet. The headline result divides it by the union of the two ranges:

IoU = I รท (A + B โˆ’ I) ร— 100 [1]

A and B are the lengths of the two ranges. This ratio is intersection over union, the standard overlap measure for comparing two regions [1]. For range A from 0 to 10 and range B from 6 to 14, I = 10 โˆ’ 6 = 4, the union is 10 + 8 โˆ’ 4 = 14, and the overlap is 4 รท 14 ร— 100 = 28.5714%. The same 4 units are 40% of range A and 50% of range B. Ranges that only touch at one endpoint, such as 0 to 5 and 5 to 9, overlap by 0%.

Limits of This Estimate

  • The interval function measures continuous length. It does not count whole numbers, so the ranges 1 to 5 and 5 to 9 share no length even though both include 5.
  • Both ranges must have a length above zero, and all four endpoints must be in the same unit.
  • A percentage is only comparable with another when both use the same reference. Overlap of the union, of range A and of the smaller range are three different figures.

Sources

  1. Rezatofighi et al., Generalized Intersection over Union: A Metric and a Loss for Bounding Box Regression (CVPR 2019): intersection over union as the shared region divided by the union of the two regions