Binary file formats

BMP row-stride planner

Calculate DWORD-aligned rows and pixel data size for uncompressed BMP.

Your inputs

Start with an example

Your inputs stay in your browser.

Your result

Example result

How it works

Row stride = ceil(width × bitsPerPixel / 32) × 4. Multiply by row count and add the supplied pixel offset.

A 3×2 24-bit image uses 12-byte rows, 24 pixel bytes and 78 total bytes at offset 54.

Limits

BI_RGB-style uncompressed rows only. Supply the real offset including palettes and masks; 54 is typical for basic 24-bit BMP.