Find the cross-sectional area of a solid round bar, a solid rectangular bar, a round tube or pipe, or a rectangular (hollow) tube. Choose a shape below, enter the dimensions you know, and the calculator shows the area along with the other section measurements.
function xsaEl(tag,attrs,html){
var e=document.createElement(tag);
if(attrs){for(var k in attrs){e.setAttribute(k,attrs[k]);}}
if(html!==undefined){e.innerHTML=html;}
return e;
}
function xsaField(id,label){
var wrap=xsaEl('div',{'class':'xsa-field'});
wrap.appendChild(xsaEl('label',{'for':id},label));
var inp=xsaEl('input',{type:'number',id:id,step:'any',min:'0'});
wrap.appendChild(inp);
return wrap;
}
function xsaRenderSubmodes(){
var host=document.getElementById('xsaSubmodes');
host.innerHTML='';
var cfg=xsaSubmodeConfig[xsaState.shape];
if(!cfg){return;}
var row=xsaEl('div',{'class':'xsa-submodes'});
cfg.forEach(function(opt){
var active=(xsaState.shape==='tube'?xsaState.tubeMode:xsaState.hrectMode)===opt.key;
var btn=xsaEl('button',{type:'button','class':'xsa-submode'+(active?' active':''),'data-key':opt.key},opt.label);
btn.addEventListener('click',function(){
if(xsaState.shape==='tube'){xsaState.tubeMode=opt.key;}else{xsaState.hrectMode=opt.key;}
xsaRenderSubmodes();
xsaRenderForm();
});
row.appendChild(btn);
});
host.appendChild(row);
}
function xsaNum(id){
var el=document.getElementById(id);
if(!el){return NaN;}
return parseFloat(el.value);
}
function xsaFmt(n){
if(!isFinite(n)){return '—';}
return (Math.round(n*10000)/10000).toString();
}
function xsaUnit(){
return document.getElementById('xsaUnit').value;
}
function xsaShowError(msg){
var e=document.getElementById('xsaError');
e.textContent=msg;
e.style.display=msg?'block':'none';
}
function xsaCalculate(){
xsaShowError('');
var u=xsaUnit();
var resultBox=document.getElementById('xsaResult');
var s=xsaState.shape;
var rows=[];
var area=NaN;
var mainLabel='Cross-Sectional Area';
try{
if(s==='circle'){
var d=xsaNum('xsaCircleD');
if(!(d>0)){throw new Error('Enter a diameter greater than 0.');}
var r=d/2;
area=Math.PI*r*r;
var circ=Math.PI*d;
rows.push(['Radius',xsaFmt(r)+' '+u]);
rows.push(['Diameter',xsaFmt(d)+' '+u]);
rows.push(['Circumference',xsaFmt(circ)+' '+u]);
}else if(s==='rectangle'){
var w=xsaNum('xsaRectW'),h=xsaNum('xsaRectH');
if(!(w>0)||!(h>0)){throw new Error('Enter a width and height greater than 0.');}
area=w*h;
var per=2*(w+h);
var diag=Math.sqrt(w*w+h*h);
rows.push(['Width',xsaFmt(w)+' '+u]);
rows.push(['Height',xsaFmt(h)+' '+u]);
rows.push(['Perimeter',xsaFmt(per)+' '+u]);
rows.push(['Diagonal',xsaFmt(diag)+' '+u]);
}else if(s==='tube'){
var od=xsaNum('xsaTubeOD');
var ro=od/2, ri;
if(xsaState.tubeMode==='thickness'){
var t=xsaNum('xsaTubeT');
if(!(od>0)||!(t>0)){throw new Error('Enter an outer diameter and wall thickness greater than 0.');}
ri=ro-t;
}else{
var id2=xsaNum('xsaTubeID');
if(!(od>0)||!(id2>0)){throw new Error('Enter an outer and inner diameter greater than 0.');}
ri=id2/2;
}
if(!(ri>=0)||ri>=ro){throw new Error('The inner diameter/wall thickness must leave a positive wall — check your values.');}
area=Math.PI*(ro*ro-ri*ri);
rows.push(['Outer Diameter',xsaFmt(od)+' '+u]);
rows.push(['Inner Diameter',xsaFmt(ri*2)+' '+u]);
rows.push(['Wall Thickness',xsaFmt(ro-ri)+' '+u]);
rows.push(['Inner Bore Area',xsaFmt(Math.PI*ri*ri)+' '+u+'²']);
mainLabel='Cross-Sectional Area (Wall Area)';
}else if(s==='hrect'){
var wo=xsaNum('xsaHrectWo'),ho=xsaNum('xsaHrectHo');
var wi,hi;
if(xsaState.hrectMode==='thickness'){
var t2=xsaNum('xsaHrectT');
if(!(wo>0)||!(ho>0)||!(t2>0)){throw new Error('Enter outer width, height, and wall thickness greater than 0.');}
wi=wo-2*t2;
hi=ho-2*t2;
}else{
wi=xsaNum('xsaHrectWi');
hi=xsaNum('xsaHrectHi');
if(!(wo>0)||!(ho>0)||!(wi>0)||!(hi>0)){throw new Error('Enter all four outer and inner dimensions, greater than 0.');}
}
if(!(wi>0)||!(hi>0)){throw new Error('The wall thickness is too large for these outer dimensions.');}
area=(wo*ho)-(wi*hi);
rows.push(['Outer Width × Height',xsaFmt(wo)+' × '+xsaFmt(ho)+' '+u]);
rows.push(['Inner Width × Height',xsaFmt(wi)+' × '+xsaFmt(hi)+' '+u]);
rows.push(['Inner (Bore) Area',xsaFmt(wi*hi)+' '+u+'²']);
mainLabel='Cross-Sectional Area (Wall Area)';
}
}catch(err){
xsaShowError(err.message);
resultBox.style.display='none';
return;
}
function xsaDraw(){
var cv=document.getElementById('xsaCanvas');
if(!cv||!cv.getContext){return;}
var ctx=cv.getContext('2d');
ctx.clearRect(0,0,cv.width,cv.height);
ctx.fillStyle='#eef2fb';
ctx.fillRect(0,0,cv.width,cv.height);
ctx.strokeStyle='#2560d6';
ctx.fillStyle='#cddafb';
ctx.lineWidth=2;
var cx=cv.width/2, cy=cv.height/2, s=xsaState.shape;
var maxR=80;
if(s==='circle'){
var d=xsaNum('xsaCircleD');
var r=(d>0)?maxR:60;
ctx.beginPath();ctx.arc(cx,cy,r,0,Math.PI*2);ctx.fill();ctx.stroke();
}else if(s==='rectangle'){
var w=xsaNum('xsaRectW'),h=xsaNum('xsaRectH');
var rw=(w>0&&h>0)?w:1, rh=(w>0&&h>0)?h:0.6;
var scale=140/Math.max(rw,rh);
var pw=rw*scale, ph=rh*scale;
ctx.fillRect(cx-pw/2,cy-ph/2,pw,ph);
ctx.strokeRect(cx-pw/2,cy-ph/2,pw,ph);
}else if(s==='tube'){
var od=xsaNum('xsaTubeOD');
var ro=(od>0)?maxR:70;
var ri=ro*0.62;
ctx.beginPath();ctx.arc(cx,cy,ro,0,Math.PI*2);ctx.fill();ctx.stroke();
ctx.fillStyle='#f7f9fc';
ctx.beginPath();ctx.arc(cx,cy,ri,0,Math.PI*2);ctx.fill();ctx.stroke();
}else if(s==='hrect'){
var wo=xsaNum('xsaHrectWo'),ho=xsaNum('xsaHrectHo');
var ow=(wo>0&&ho>0)?wo:1, oh=(wo>0&&ho>0)?ho:0.7;
var scale2=150/Math.max(ow,oh);
var pow=ow*scale2, poh=oh*scale2;
ctx.fillRect(cx-pow/2,cy-poh/2,pow,poh);
ctx.strokeRect(cx-pow/2,cy-poh/2,pow,poh);
var inset=Math.min(pow,poh)*0.28;
ctx.fillStyle='#f7f9fc';
ctx.fillRect(cx-pow/2+inset,cy-poh/2+inset,pow-2*inset,poh-2*inset);
ctx.strokeRect(cx-pow/2+inset,cy-poh/2+inset,pow-2*inset,poh-2*inset);
}
}
function xsaSwitchShape(shape){
xsaState.shape=shape;
var tabs=document.querySelectorAll('#xsaTabs .xsa-tab');
tabs.forEach(function(t){t.classList.toggle('active',t.getAttribute('data-shape')===shape);});
document.getElementById('xsaResult').style.display='none';
xsaShowError('');
xsaRenderSubmodes();
xsaRenderForm();
}
Cross-sectional area is the area of the flat “slice” you would see if you cut straight through a solid or a tube, perpendicular to its length. It’s a different measurement from surface area (the area of the outer skin of a 3D object) and from a duct or pipe’s bend-development area (the flattened material needed to fabricate a curved section). Engineers, machinists, and DIYers use cross-sectional area to size structural bar stock, estimate the material in a solid rod, work out how much metal is in a tube’s wall, and compare the flow-carrying area of pipes.
This calculator covers four common cross-section shapes: solid circles (round bar or rod), solid rectangles (bar stock, planks, beams of rectangular section), round tubes or pipes (an annulus — a circle with a circular hole in the middle), and rectangular or square hollow tubes. For the tube shapes, you can enter either the wall thickness or the inner dimensions directly, whichever you have on hand.
This tool doesn’t cover standardized structural beam profiles such as I-beams, channels, angles, or T-sections. Those shapes have published section-property tables (area, moment of inertia, section modulus) that vary by manufacturer and standard, so calculating them accurately means looking up the specific profile rather than a general geometry formula.
What Is Cross-Sectional Area?
Cross-sectional area is the two-dimensional area exposed when a 3D shape is cut by a plane perpendicular to its length. For a straight bar, pipe, or tube, that cut looks the same all along its length, so one cross-sectional area figure describes the whole piece. It’s expressed in squared length units (mm², in², etc.) — the same units you’d use for any flat area.
Cross-Sectional Area vs. Surface Area
Surface area is the area of a shape’s outer skin — for a cylinder, that includes the curved side plus both circular ends. Cross-sectional area is just the area of one internal slice. A 2-meter length of round bar and a 2-centimeter length of the same bar share the same cross-sectional area, even though their surface areas are very different.
Circle Cross-Sectional Area (Solid Round Bar or Rod)
Formula
Area = π × r² = π × (D / 2)²
Where:
A = cross-sectional area
r = radius
D = diameter
Worked Example
A solid round bar has a diameter of 20 mm. The radius is 10 mm, so:
Area = π × 10² = π × 100 ≈ 314.16 mm²
The bar’s cross-section covers about 314.16 square millimeters.
Rectangle Cross-Sectional Area (Solid Bar or Beam)
Formula
Area = Width × Height
Worked Example
A rectangular bar measures 40 mm wide by 20 mm high:
Area = 40 × 20 = 800 mm²
Round Tube or Pipe Cross-Sectional Area (Annulus)
A round tube’s cross-section is an annulus: the area of the outer circle minus the area of the inner circle (the bore). This is the amount of solid material in the tube’s wall, not the open flow area inside it.
If you already know both diameters rather than the wall thickness, use them directly: Inner radius = Inner diameter / 2, then apply the same area formula above.
Worked Example
A pipe has a 60 mm outer diameter and a 50 mm inner diameter. Outer radius = 30 mm, inner radius = 25 mm:
If the wall thickness isn’t uniform, or you simply know both sets of dimensions already, enter the outer and inner width/height directly and skip the wall-thickness step.
Worked Example
An outer rectangle of 80 mm × 40 mm with an inner opening of 70 mm × 32 mm:
Cross-sectional area comes up whenever the amount of solid material in a slice matters more than the shape’s overall length: estimating the weight of a length of bar stock or tubing (combined with material density), comparing how much metal is in different wall thicknesses of the same tube, or checking the load-bearing area of a column or support before consulting an engineer for a full structural check. It’s also useful groundwork for HVAC and plumbing calculations, though duct and pipe airflow or fabrication sizing (bend allowances, flat-pattern development) are separate calculations from the cross-sectional area itself.
It’s used to estimate the material in a solid bar or tube wall, compare tube or pipe wall thicknesses, and as a starting figure for structural or weight calculations. It is not, by itself, a strength or load-capacity rating.
How do I find the cross-sectional area of a pipe?
Treat the pipe as an annulus: find the area of the full outer circle, then subtract the area of the inner circle (the bore). Use either the wall thickness or the inner diameter, whichever you know, with the Round Tube mode above.
What’s the difference between cross-sectional area and flow area?
Cross-sectional area (as calculated here) is the area of the solid tube wall itself. Flow area is the open area inside the bore — the inner circle’s or inner rectangle’s area alone, which this calculator also reports alongside the wall area for tube and hollow-rectangle modes.
Does wall thickness affect the cross-sectional area of a tube?
Yes. A thicker wall (for the same outer diameter) means a larger inner radius is subtracted less, so more material remains and the cross-sectional area increases. Two tubes with the same outer diameter but different wall thicknesses have different cross-sectional areas.
Can I use this for structural beams like I-beams or angles?
Not directly. Standardized structural profiles (I-beams, channels, angles, T-sections) have irregular cross-sections defined by manufacturer section tables rather than a single width-and-height formula, so they need a dedicated structural-shapes reference rather than this general calculator.
Mark Danny
Mark Danny builds and maintains the free calculators and guides on Area of Irregular Shapes Calculator. Every calculator page explains its formula and shows a worked example, so you can check the working yourself. Spotted a mistake or have a suggestion? Email gulsher.hingoro101@gmail.com.