Cubic In Cylinder Calculator
Find the side of the largest upright cube that fits inside a cylinder of given radius (side = r√2) and how much of the cylinder's volume it fills.
Cubic In Cylinder Calculator
Background.
Fitting a square inside a circle is one of the oldest practical problems in geometry. A sawyer squaring a round log, a machinist milling a square section from round bar and a packer sliding a box into a drum are all asking the same thing: how big can the square be before its corners hit the curve?
For a cube standing upright in a cylinder, the answer depends only on the radius. Look down the cylinder's axis and the cube becomes a square sitting inside a circle. The largest such square touches the circle at all four corners, so its diagonal runs straight across the circle and equals the diameter. A square's diagonal is its side times √2, so the side is the diameter divided by √2, which simplifies to the radius times √2: about 1.414 × r, or 0.707 of the diameter.
The share of space used is the same at every size. The square covers 2/π of the circle, about 63.66%, and since the cube and the matching slice of cylinder have equal height, the cube fills 63.66% of that slice's volume too. The other 36.34% is the four curved slivers between the cube's faces and the wall. Turn the problem around, a round peg in a square hole, and the fit is better: a circle fills π/4, about 78.5%, of the square around it.
Two assumptions are built in. The cube is centred and upright, its faces parallel to the cylinder's axis; tilted or rotated placements are not considered. And the cylinder is taken to be at least as tall as the cube's side. If it is shorter than about 1.414 times its radius, height becomes the limit and the cube must be smaller than the figure shown.
What is cubic in cylinder calculator?
The inscribed cube here is the largest cube that can stand upright and centred inside a right circular cylinder, with its four vertical edges touching the curved wall. Its side length is r√2, where r is the cylinder's radius. The companion figure is the cube's volume as a percentage of a section of the cylinder exactly as tall as the cube, which works out to 2/π, about 63.66%, whatever the radius.
How to use this calculator.
- Enter the cylinder's radius, half its diameter. A measured diameter of 10 cm goes in as 5.
- Any length unit works, and the cube side comes back in the same unit, so millimetres in means millimetres out.
- For a container, pipe or bore, measure the inside diameter, because the cube has to clear the inner face of the wall.
- Check that the cylinder is at least 1.414 times its radius tall. If it is shorter, height limits the cube and its side cannot exceed that height.
The formula.
side = r × √2. Viewed from above, the cube is a square inscribed in a circle of radius r. The square's diagonal is a diameter of the circle, 2r, and by Pythagoras the diagonal of a square of side s is s√2. Setting s√2 = 2r gives s = 2r ÷ √2 = r√2, with √2 ≈ 1.41421.
The fill ratio compares the cube's volume s³ with a cylinder of the same height, πr² × s. Dividing, s³ ÷ (πr²s) = s² ÷ πr² = 2r² ÷ πr² = 2/π, about 63.66%. Because the radius cancels, every cylinder gives the same ratio; only the side length scales, in direct proportion to r. Mixing up radius and diameter is the one mistake that matters, and it doubles or halves the side.
A worked example.
A cylinder of radius 5 (diameter 10, in any unit) needs the largest cube that will stand upright inside it. The square cross-section's diagonal must equal the diameter, 10, so the side is 10 ÷ √2 = 5 × √2 ≈ 7.0711. As a check, 7.0711 × 1.41421 brings the diagonal back to 10. The cube's volume is 7.0711³ ≈ 353.55 cubic units. A slice of the cylinder 7.0711 tall holds π × 5² × 7.0711 ≈ 555.36, so the cube fills 353.55 ÷ 555.36 = 63.66% of it. If the cylinder were a full 10 units tall, the same cube would occupy only about 45% of it.
Frequently asked questions.
What size square beam can be cut from a round log?
Why is the fill ratio 63.66% whatever radius I enter?
Does a round peg fit a square hole better than a square peg fits a round hole?
What if the cylinder is shorter than the cube would be?
Should I measure the inside or the outside of a pipe?
How long are the diagonals of the inscribed cube?
References& sources.
- [1]OpenStax, Rice University. Precalculus 2e, 2021. Trigonometry and analytic geometry chapters. Retrieved 2026-08-06.
- [2]OpenStax, Rice University. College Algebra 2e, 2021. Algebra and function chapters. Retrieved 2026-08-06.
- [3]NIST/SEMATECH. e-Handbook of Statistical Methods, 2012. Chapter 1.3 and Chapter 4. Retrieved 2026-08-06.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 3 cited below
- Method
- For a cube spanning a cylinder diameter, side=r√2
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled