ratio.

Find a tool

Browse all tools and categories ↗
GEOMETRY

Rectangle Overlap and IoU Calculator

Calculate intersection area, union area and coverage fractions for two axis-aligned rectangles.

Enter your values

01 / INPUT
Calculated on your device

YOUR CALCULATION

Result

—

Calculation steps

Work through one step at a time or reveal the complete calculation. The steps use your current inputs.

    How to calculate

    Intersect the two coordinate ranges on each axis and multiply nonnegative overlap dimensions. Subtract shared area once when calculating the union.

    Intersection=max(0,min xmax−max xmin)×max(0,min ymax−max ymin); IoU=intersection/(A+B−intersection)

    Worked example

    Rectangles (0,0)–(4,3) and (2,1)–(6,4) each have area 12, overlap area 4, union area 20 and IoU 20%.

    Assumptions and input details

    Use a common Cartesian length or pixel-coordinate unit; rectangle maxima must strictly exceed minima. Coordinates have magnitude at most 1e9. Boundaries are continuous, without an inclusive-pixel +1 convention. Touching edges alone give zero area. Rotated rectangles, polygons, image uploads and object-detection accuracy are outside this geometry calculation.

    Using this calculator

    Can I enter my own problem?

    Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.

    Are the results exact?

    Results use floating-point arithmetic and displayed rounding. Read the formula, assumptions and any stated data precision before interpreting the result.

    Is my input uploaded?

    The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.

    RELATED TOOL · DESIGNAspect Ratio and Crop Size Calculator

    Calculate a centered crop or a whole-image resize inside a target pixel box. Inspect retained area, edge trims, output dimensions and upscaling.

    RELATED TOOL · GEOMETRYPolygon Area from Coordinates

    Calculate area, perimeter and area centroid from 3–50 ordered vertices of a simple polygon. Inspect an equal-scale outline and a table of edges.

    RELATED TOOL · COLORRGB Alpha Source Over Calculator

    Combine foreground and background colors with separate opacity values and report straight and premultiplied output channels.

    ADVERTISEMENT

    Reserved advertising space.