CSS Box Model Calculator
Calculate content, padding, border, and margin box dimensions.
- Free
- No sign-up
- Runs in your browser
- Nothing uploaded
Scope: The utility uses supplied numeric dimensions only and does not inspect layout, CSS cascade, writing mode, or a DOM.
Workbench
Inputs stay on this page. Press Ctrl or ⌘ + Enter to run.
How to use CSS Box Model Calculator
Fill in the fields:
- Box sizing: content-box, border-box.
- Declared width (px): 0 to 1,000,000.
- Declared height (px): 0 to 1,000,000.
- Horizontal padding per side (px): 0 to 1,000,000.
- Vertical padding per side (px): 0 to 1,000,000.
- Horizontal border per side (px): 0 to 1,000,000.
- Vertical border per side (px): 0 to 1,000,000.
- Horizontal margin per side (px): 0 to 1,000,000.
- Vertical margin per side (px): 0 to 1,000,000.
Press “Calculate box dimensions”.
Copy the result, or download it as css-box-model.json.
About this tool
Calculate content, padding, border, and margin box dimensions.
Uses explicit pixel inputs only. No DOM or computed style is inspected.

