Object Fit Calculator

Calculate contain, cover, none, or scale-down image placement.

Scope: The calculation uses supplied dimensions and position percentages without loading, rendering, or inspecting an image.

Workbench

Inputs stay on this page.

Geometry only. No image is loaded, decoded, cropped, or rendered.

How to use Object Fit Calculator

  1. Fill in the fields:

    • Source width: 0.001 to 1,000,000.
    • Source height: 0.001 to 1,000,000.
    • Container width: 0.001 to 1,000,000.
    • Container height: 0.001 to 1,000,000.
    • object-fit: contain, cover, none, scale-down.
    • Horizontal object position (%): 0 to 100.
    • Vertical object position (%): 0 to 100.
  2. Press “Calculate object fit”.

  3. Copy the result, or download it as object-fit.json.

About this tool

Calculate contain, cover, none, or scale-down image placement.

Geometry only. No image is loaded, decoded, cropped, or rendered.