Package Dimension Calculator

Accurately calculate dimensional (DIM) weight for any package using carrier-specific divisors. Compare actual vs. dimensional weight to determine billable weight, calculate girth and length+girth for size limit checks, and estimate freight class based on package density. Supports UPS, FedEx, USPS, DHL, and custom divisors.

Shipping & Logistics

Try the Calculator

Package Dimension Calculator
📦 Package Dimensions
 
 
 
 
 
🚚 Carrier Settings
 
⚠️ Size Limit Checks

📊 Calculated Dimensions
$ 960.00
in³
$ 0.56
ft³
$ 36.00
"
$ 48.00
"
$ 3.60
lbs/ft³
Class 250
⚖️ Weight Comparison
$ 2.00
lbs
$ 6.91
lbs
⚠️ DIM weight is 4.9 lbs higher - you'll be charged for DIM weight
📋 Summary
$ 6.91
lbs
Dimensional weight may vary by carrier. Always verify with your shipping provider.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
export function packageDimensionCalculator(form: FormTs) {
form.addRow(row => {
row.addTextPanel('header', {
computedValue: () => 'Package Dimension Calculator',
customStyles: { 'font-size': '1.5rem', 'font-weight': '600', 'color': '#1e293b' }
});
});
 
form.addSpacer({ height: 20 });
 
// Package Dimensions Section
const dimensionsSection = form.addSubform('dimensions', { title: '📦 Package Dimensions' });
 
dimensionsSection.addRow(row => {
row.addDropdown('unitSystem', {
label: 'Unit System',
options: [
{ id: 'imperial', name: 'Imperial (inches/lbs)' },
{ id: 'metric', name: 'Metric (cm/kg)' }
],
defaultValue: 'imperial',
isRequired: true
}, '1fr');
row.addDropdown('packageShape', {
label: 'Package Shape',
options: [
{ id: 'box', name: 'Box/Rectangular' },
{ id: 'tube', name: 'Tube/Cylinder' },
{ id: 'irregular', name: 'Irregular Shape' }
],
defaultValue: 'box'
}, '1fr');
});
 
dimensionsSection.addRow(row => {
row.addDecimal('length', {
label: () => dimensionsSection.dropdown('unitSystem')?.value() === 'metric' ? 'Length (cm)' : 'Length (inches)',
min: 0.1,
max: 300,
defaultValue: 12,
step: 0.1,
isRequired: true
}, '1fr');
row.addDecimal('width', {
label: () => dimensionsSection.dropdown('unitSystem')?.value() === 'metric' ? 'Width (cm)' : 'Width (inches)',
min: 0.1,
max: 300,
defaultValue: 10,
step: 0.1,
isRequired: true
}, '1fr');
row.addDecimal('height', {
label: () => dimensionsSection.dropdown('unitSystem')?.value() === 'metric' ? 'Height (cm)' : 'Height (inches)',
min: 0.1,
max: 300,
defaultValue: 8,
step: 0.1,
isRequired: true
}, '1fr');
});
 
dimensionsSection.addRow(row => {
row.addDecimal('actualWeight', {
label: () => dimensionsSection.dropdown('unitSystem')?.value() === 'metric' ? 'Actual Weight (kg)' : 'Actual Weight (lbs)',
min: 0.01,
max: 150,
defaultValue: 2,
step: 0.01,
isRequired: true
}, '1fr');
row.addInteger('quantity', {
label: 'Number of Packages',
min: 1,
max: 1000,
defaultValue: 1
}, '1fr');
});
 
// Carrier Settings Section
const carrierSection = form.addSubform('carrier', { title: '🚚 Carrier Settings' });
 
carrierSection.addRow(row => {
row.addRadioButton('carrier', {
label: 'Carrier/Divisor Standard',
options: [
{ id: 'ups-fedex', name: 'UPS/FedEx (139 divisor)' },
{ id: 'usps', name: 'USPS (166 divisor)' },
{ id: 'dhl', name: 'DHL International (5000 metric)' },
{ id: 'freight', name: 'Freight/LTL (194 divisor)' },
{ id: 'custom', name: 'Custom Divisor' }
],
defaultValue: 'ups-fedex',
orientation: 'vertical'
});
});
 
carrierSection.addRow(row => {
row.addDecimal('customDivisor', {
label: 'Custom DIM Divisor',
min: 1,
max: 10000,
defaultValue: 139,
step: 1,
isVisible: () => carrierSection.radioButton('carrier')?.value() === 'custom',
tooltip: 'Enter your carrier\'s dimensional weight divisor'
});
});
 
// Size Limits Check Section
const limitsSection = form.addSubform('limits', { title: '⚠️ Size Limit Checks' });
 
limitsSection.addRow(row => {
row.addCheckbox('checkUPS', {
label: 'Check UPS Limits',
defaultValue: true,
tooltip: 'Max: 165" length+girth, 150 lbs'
}, '1fr');
row.addCheckbox('checkFedEx', {
label: 'Check FedEx Limits',
defaultValue: true,
tooltip: 'Max: 165" length+girth, 150 lbs'
}, '1fr');
});
 
limitsSection.addRow(row => {
row.addCheckbox('checkUSPS', {
label: 'Check USPS Limits',
defaultValue: false,
tooltip: 'Max: 130" length+girth, 70 lbs'
}, '1fr');
row.addCheckbox('checkFreight', {
label: 'Check for Freight Required',
defaultValue: false,
tooltip: 'Over 150 lbs or oversized'
}, '1fr');
});
 
form.addSpacer({ height: 20, showLine: true, lineStyle: 'dashed' });
 
// Calculations Section
const resultsSection = form.addSubform('results', { title: '📊 Calculated Dimensions', isCollapsible: false });
 
const getConvertedDimensions = () => {
const unitSystem = dimensionsSection.dropdown('unitSystem')?.value() || 'imperial';
let length = dimensionsSection.decimal('length')?.value() ?? 12;
let width = dimensionsSection.decimal('width')?.value() ?? 10;
let height = dimensionsSection.decimal('height')?.value() ?? 8;
let weight = dimensionsSection.decimal('actualWeight')?.value() ?? 2;
 
// Convert to imperial if metric
if (unitSystem === 'metric') {
length = length / 2.54;
width = width / 2.54;
height = height / 2.54;
weight = weight * 2.20462;
}
 
// Sort dimensions (longest = length)
const sorted = [length, width, height].sort((a, b) => b - a);
 
return {
length: sorted[0] ?? 12,
width: sorted[1] ?? 10,
height: sorted[2] ?? 8,
weight,
isMetric: unitSystem === 'metric'
};
};
 
const getDivisor = () => {
const carrier = carrierSection.radioButton('carrier')?.value() || 'ups-fedex';
const unitSystem = dimensionsSection.dropdown('unitSystem')?.value() || 'imperial';
 
const divisors = {
'ups-fedex': 139,
'usps': 166,
'dhl': unitSystem === 'metric' ? 5000 : 139,
'freight': 194,
'custom': carrierSection.decimal('customDivisor')?.value() || 139
};
 
return divisors[carrier];
};
 
const calculateAll = () => {
const dims = getConvertedDimensions();
const divisor = getDivisor();
const quantity = dimensionsSection.integer('quantity')?.value() || 1;
const unitSystem = dimensionsSection.dropdown('unitSystem')?.value() || 'imperial';
 
// Calculate cubic inches/cm
const cubicInches = dims.length * dims.width * dims.height;
const cubicCm = cubicInches * 16.387;
const cubicFeet = cubicInches / 1728;
 
// Dimensional weight
let dimWeight = cubicInches / divisor;
if (unitSystem === 'metric' && carrierSection.radioButton('carrier')?.value() === 'dhl') {
dimWeight = (dims.length * 2.54 * dims.width * 2.54 * dims.height * 2.54) / 5000;
dimWeight = dimWeight * 2.20462; // Convert to lbs for comparison
}
 
// Billable weight
const billableWeight = Math.max(dims.weight, dimWeight);
 
// Girth calculation (2 * width + 2 * height)
const girth = 2 * (dims.width + dims.height);
const lengthPlusGirth = dims.length + girth;
 
// Package density (lbs per cubic foot)
const density = dims.weight / cubicFeet;
 
// Freight class estimation based on density
let freightClass = '500';
if (density >= 50) freightClass = '50';
else if (density >= 35) freightClass = '55';
else if (density >= 30) freightClass = '60';
else if (density >= 22.5) freightClass = '65';
else if (density >= 15) freightClass = '70';
else if (density >= 13.5) freightClass = '77.5';
else if (density >= 12) freightClass = '85';
else if (density >= 10.5) freightClass = '92.5';
else if (density >= 9) freightClass = '100';
else if (density >= 8) freightClass = '110';
else if (density >= 7) freightClass = '125';
else if (density >= 6) freightClass = '150';
else if (density >= 5) freightClass = '175';
else if (density >= 4) freightClass = '200';
else if (density >= 3) freightClass = '250';
else if (density >= 2) freightClass = '300';
else if (density >= 1) freightClass = '400';
 
// Size limit checks
const warnings: string[] = [];
if (limitsSection.checkbox('checkUPS')?.value()) {
if (lengthPlusGirth > 165) warnings.push('Exceeds UPS max length+girth (165")');
if (dims.weight > 150) warnings.push('Exceeds UPS max weight (150 lbs)');
if (dims.length > 108) warnings.push('Exceeds UPS max length (108")');
}
if (limitsSection.checkbox('checkFedEx')?.value()) {
if (lengthPlusGirth > 165) warnings.push('Exceeds FedEx max length+girth (165")');
if (dims.weight > 150) warnings.push('Exceeds FedEx max weight (150 lbs)');
}
if (limitsSection.checkbox('checkUSPS')?.value()) {
if (lengthPlusGirth > 130) warnings.push('Exceeds USPS max length+girth (130")');
if (dims.weight > 70) warnings.push('Exceeds USPS max weight (70 lbs)');
}
if (limitsSection.checkbox('checkFreight')?.value()) {
if (dims.weight > 150 || lengthPlusGirth > 165) {
warnings.push('May require freight shipping');
}
}
 
return {
cubicInches: Math.round(cubicInches * 100) / 100,
cubicCm: Math.round(cubicCm * 100) / 100,
cubicFeet: Math.round(cubicFeet * 1000) / 1000,
dimWeight: Math.round(dimWeight * 100) / 100,
actualWeight: Math.round(dims.weight * 100) / 100,
billableWeight: Math.round(billableWeight * 100) / 100,
girth: Math.round(girth * 100) / 100,
lengthPlusGirth: Math.round(lengthPlusGirth * 100) / 100,
density: Math.round(density * 100) / 100,
freightClass,
totalBillableWeight: Math.round(billableWeight * quantity * 100) / 100,
warnings,
quantity
};
};
 
resultsSection.addRow(row => {
row.addPriceDisplay('cubicInches', {
label: 'Volume (cubic inches)',
computedValue: () => calculateAll().cubicInches,
prefix: '',
suffix: ' in³',
variant: 'default'
}, '1fr');
row.addPriceDisplay('cubicFeet', {
label: 'Volume (cubic feet)',
computedValue: () => calculateAll().cubicFeet,
prefix: '',
suffix: ' ft³',
variant: 'default'
}, '1fr');
});
 
resultsSection.addRow(row => {
row.addPriceDisplay('girth', {
label: 'Girth',
computedValue: () => calculateAll().girth,
prefix: '',
suffix: '"',
variant: 'default'
}, '1fr');
row.addPriceDisplay('lengthGirth', {
label: 'Length + Girth',
computedValue: () => calculateAll().lengthPlusGirth,
prefix: '',
suffix: '"',
variant: 'default'
}, '1fr');
});
 
resultsSection.addRow(row => {
row.addPriceDisplay('density', {
label: 'Package Density',
computedValue: () => calculateAll().density,
prefix: '',
suffix: ' lbs/ft³',
variant: 'default'
}, '1fr');
row.addTextPanel('freightClass', {
label: 'Estimated Freight Class',
computedValue: () => `Class ${calculateAll().freightClass}`,
customStyles: { 'font-weight': '600', 'color': '#3b82f6' }
}, '1fr');
});
 
// Weight Comparison Section
const weightSection = form.addSubform('weight', { title: '⚖️ Weight Comparison', isCollapsible: false });
 
weightSection.addRow(row => {
row.addPriceDisplay('actualWeight', {
label: 'Actual Weight',
computedValue: () => calculateAll().actualWeight,
prefix: '',
suffix: ' lbs',
variant: 'default'
}, '1fr');
row.addPriceDisplay('dimWeight', {
label: 'Dimensional Weight',
computedValue: () => calculateAll().dimWeight,
prefix: '',
suffix: ' lbs',
variant: 'default'
}, '1fr');
});
 
weightSection.addRow(row => {
row.addTextPanel('weightNote', {
computedValue: () => {
const calc = calculateAll();
if (calc.dimWeight > calc.actualWeight) {
return `⚠️ DIM weight is ${Math.round((calc.dimWeight - calc.actualWeight) * 10) / 10} lbs higher - you'll be charged for DIM weight`;
}
return '✅ Actual weight is higher - standard weight pricing applies';
},
customStyles: { 'font-size': '0.9rem', 'text-align': 'center' }
});
});
 
// Warnings Section
resultsSection.addRow(row => {
row.addTextPanel('warnings', {
computedValue: () => {
const warnings = calculateAll().warnings;
if (warnings.length === 0) return '';
return '⚠️ ' + warnings.join('\n⚠️ ');
},
customStyles: { 'font-size': '0.9rem', 'color': '#dc2626', 'white-space': 'pre-line' },
isVisible: () => calculateAll().warnings.length > 0
});
});
 
// Summary Section
const summarySection = form.addSubform('summary', {
title: '📋 Summary',
isCollapsible: false,
sticky: 'bottom'
});
 
summarySection.addRow(row => {
row.addPriceDisplay('billableWeight', {
label: 'Billable Weight (per package)',
computedValue: () => calculateAll().billableWeight,
prefix: '',
suffix: ' lbs',
variant: 'large'
}, '1fr');
row.addPriceDisplay('totalWeight', {
label: () => `Total Billable (${calculateAll().quantity} packages)`,
computedValue: () => calculateAll().totalBillableWeight,
prefix: '',
suffix: ' lbs',
variant: 'success',
isVisible: () => calculateAll().quantity > 1
}, '1fr');
});
 
summarySection.addRow(row => {
row.addTextPanel('disclaimer', {
computedValue: () => 'Dimensional weight may vary by carrier. Always verify with your shipping provider.',
customStyles: { 'font-size': '0.8rem', 'color': '#64748b', 'text-align': 'center' }
});
});
 
form.configureSubmitButton({
label: 'Get Shipping Quote'
});
}
 

Frequently Asked Questions

What is dimensional weight?

Dimensional weight (DIM weight) is a pricing technique that considers package size, not just weight. Carriers charge based on whichever is greater: actual weight or dimensional weight.

What DIM divisor should I use?

UPS and FedEx use 139 for domestic shipments. USPS uses 166. DHL uses 5000 (metric). Always verify with your carrier as divisors may vary by service level.

What is length plus girth?

Length + Girth is calculated as: Length + (2 × Width) + (2 × Height). Most carriers limit this to 165 inches for standard shipping.

When is freight shipping required?

Generally, packages over 150 lbs or exceeding 165 inches in length+girth require freight shipping (LTL or FTL) instead of parcel carriers.

Can I customize this for my shipping business?

Yes! E-commerce businesses and fulfillment centers can customize this calculator with their specific carrier agreements and embed it on their website.