A Shipping Cube Calculator, often referred to as a volume calculator or dimensional weight calculator, is a crucial tool for anyone involved in shipping goods. It helps determine the physical space a package occupies (its volume) and, more importantly, calculates its "dimensional weight." This is a value used by shipping carriers to determine shipping costs, often based on the package's size rather than its actual weight, especially for lighter but bulky items. Understanding and accurately calculating this can lead to significant cost savings and more efficient logistics planning.
Who should use it?
E-commerce businesses: To accurately estimate shipping costs for customers and optimize packaging.
Logistics and fulfillment centers: To manage inventory space and shipping charges efficiently.
Small businesses and individuals: Anyone shipping packages regularly can benefit from understanding how size impacts cost.
Warehouse managers: To optimize storage space and understand the cubic capacity of their inventory.
Common Misconceptions:
"It's just about actual weight." Many assume shipping costs are solely based on how heavy a package is. However, dimensional weight often plays a significant role, especially for carriers like FedEx, UPS, and USPS.
"All carriers use the same formula." While the concept of dimensional weight is common, the specific "dimensional factor" (the divisor used in the calculation) can vary between carriers and even service types. Always verify the factor used by your chosen carrier.
"Bigger packages always cost more." Not necessarily. A large, very light package might incur higher costs due to dimensional weight, while a smaller, dense package might be charged based on its actual weight. The calculator helps identify which factor is dominant.
Shipping Cube Calculator Formula and Mathematical Explanation
The core of the shipping cube calculator involves two main calculations: the package's volume and its dimensional weight. The final "chargeable weight" is then determined by comparing the dimensional weight to the actual weight.
1. Package Volume Calculation
This is a straightforward geometric calculation:
Volume = Length × Width × Height
2. Dimensional Weight Calculation
Shipping carriers use dimensional weight to account for the space a package occupies. The formula typically involves dividing the package's volume by a specific "dimensional factor" provided by the carrier.
Interpretation: Even though the pillow only weighs 2 lbs, the shipping carrier will charge based on a weight of approximately 10.88 lbs due to its size. The retailer must factor this higher chargeable weight into their shipping costs when pricing orders or selecting a shipping service.
Example 2: International Shipment (Metric)
A company is shipping a small, dense electronic component internationally using a carrier that uses metric units and a dimensional factor of 5000.
Inputs:
Length: 30 cm
Width: 20 cm
Height: 10 cm
Unit: Centimeters
Actual Weight: 3 kg
Weight Unit: Kilograms
Dimensional Factor: 5000 (common for international metric shipping)
Calculation:
Volume = 30 cm × 20 cm × 10 cm = 6000 cubic centimeters
Interpretation: In this case, the actual weight (3 kg) is significantly higher than the dimensional weight (1.2 kg). The carrier will bill based on the actual weight of 3 kg. This highlights how the relationship between size and density affects shipping costs.
How to Use This Shipping Cube Calculator
Using this calculator is simple and designed to provide quick, actionable insights into your shipping costs. Follow these steps:
Measure Your Package: Accurately measure the Length, Width, and Height of your package in the same unit of measurement. Ensure you measure the longest side as Length, the next longest as Width, and the shortest as Height.
Select Units: Choose the correct unit of measurement (e.g., inches, centimeters) for your dimensions using the 'Unit of Measurement' dropdown.
Enter Actual Weight: Input the precise weight of your package using the 'Actual Weight' field and select the corresponding 'Weight Unit' (e.g., pounds, kilograms).
Input Dimensional Factor: Enter the dimensional factor specific to your shipping carrier. A common default (e.g., 139 for lb/in³ or 5000 for kg/cm³) is provided, but always verify this with your carrier's guidelines.
Click Calculate: Press the 'Calculate' button.
How to Read Results:
Primary Result (Chargeable Weight): This is the most important figure. It's the weight your shipping carrier will use for billing. It will be either the actual weight or the dimensional weight, whichever is greater.
Calculated Volume: Shows the total cubic space your package occupies in your chosen units (e.g., cubic inches, cubic centimeters).
Dimensional Weight: This is the weight calculated based on the package's size and the dimensional factor. It helps you understand the "size penalty" if applicable.
Comparison Table: Provides a clear breakdown of all calculated values, allowing for easy comparison between volume, dimensional weight, actual weight, and the final chargeable weight.
Chart: Visually represents how the calculated volume and dimensional weight compare, offering a quick understanding of which factor is dominant.
Decision-Making Guidance:
If the Chargeable Weight is significantly higher than the Actual Weight, consider optimizing your packaging. Can you use a smaller box? Can you consolidate multiple items into a larger, denser package?
If the Actual Weight is higher than the Dimensional Weight, your package is likely dense, and costs will be based primarily on weight.
Always double-check the Dimensional Factor with your specific carrier (e.g., UPS, FedEx, USPS, DHL) as it can vary. Using the wrong factor will lead to inaccurate cost estimations.
Use the insights to negotiate better rates with carriers or to inform your pricing strategy for customers. For more detailed cost analysis, consider using a comprehensive shipping cost calculator.
Key Factors That Affect Shipping Cube Results
Several factors influence the results of a shipping cube calculation and, consequently, the final shipping cost. Understanding these can help you make informed decisions:
Package Dimensions (L x W x H): This is the most direct input. Larger dimensions directly increase the calculated volume and, subsequently, the dimensional weight. Even a small increase in one dimension can significantly impact the total volume.
Dimensional Factor: As discussed, this is a critical variable set by the carrier. A higher dimensional factor results in a lower dimensional weight for the same volume, making it less likely for size to dictate the cost. Conversely, a lower factor increases the dimensional weight. Always confirm the correct factor for your carrier and region. For instance, using a metric factor (like 5000 or 6000 cm³/kg) with imperial measurements (inches) will yield incorrect results.
Actual Weight: This is the other primary determinant of the chargeable weight. If the actual weight is substantially greater than the dimensional weight, it becomes the basis for shipping charges. Dense, heavy items are typically charged by actual weight.
Unit Consistency: Using mixed units (e.g., measuring length in feet but width in inches) without proper conversion will lead to drastically incorrect volume calculations. Ensure all dimensions are in the same unit before calculation. Similarly, ensure weight units align with the dimensional factor's requirements.
Packaging Optimization: The way items are packed matters. Over-packaging (using a box much larger than necessary) inflates dimensions and increases dimensional weight. Efficient packing, using appropriately sized boxes, or consolidating multiple items can reduce the overall shipping cube and associated costs.
Carrier Policies: Different carriers have different dimensional weight rules, minimum charges, and dimensional factors. Some may have limits on the maximum size or weight they accept. Understanding these policies is crucial for accurate cost estimation and avoiding unexpected fees. For example, USPS has specific rules for certain package types.
Service Level: Sometimes, the dimensional weight rules or factors can vary slightly depending on the shipping service chosen (e.g., express vs. standard ground). Always check the specifics for the service you intend to use.
Frequently Asked Questions (FAQ)
What is the difference between volume and dimensional weight?
Volume is the total cubic space a package occupies (Length x Width x Height). Dimensional weight is a value calculated by carriers by dividing the volume by a specific factor. It represents the "weight" a package would have if it were as dense as the carrier's standard.
How do I find the correct dimensional factor for my carrier?
Check the carrier's official website or contact their customer service. Common factors are 139 or 166 for lb/in³ (imperial) and 5000 or 6000 for kg/cm³ (metric), but these can change or vary by service.
Does dimensional weight apply to all packages?
Most major carriers apply dimensional weight rules to packages exceeding certain size thresholds (e.g., over 1 cubic foot) or to all packages regardless of size, charging based on whichever weight (actual or dimensional) is greater.
Can I round up the dimensions or weight?
It's best practice to measure as accurately as possible. Carriers often round up the dimensional weight to the nearest pound or kilogram. Check your carrier's specific rounding rules.
What if my package is irregularly shaped?
For irregularly shaped items, carriers typically require you to measure the package's bounding box (the smallest rectangular prism that can contain the item) or to measure the longest points in each dimension. Consult your carrier for specific instructions.
How does this relate to shipping costs?
The 'Chargeable Weight' calculated by this tool is the primary factor carriers use to determine your shipping cost, alongside distance, service level, and any surcharges. A higher chargeable weight generally means a higher shipping cost.
Should I always use the smallest possible box?
While minimizing the shipping cube is often cost-effective, ensure the box is large enough to protect the contents adequately and allow for cushioning material. Overly small boxes can lead to damaged goods and higher costs due to returns or replacements.
Can I use this calculator for freight shipping (LTL/FTL)?
This calculator is primarily designed for parcel shipping. Freight shipping (Less Than Truckload or Full Truckload) is calculated differently, often based on freight classes, density, pallet dimensions, and total weight, rather than a simple dimensional weight factor.
Estimate how much storage space your inventory will occupy.
var ctx;
var weightComparisonChart;
function initializeChart() {
var canvas = document.getElementById('weightComparisonChart');
if (canvas) {
ctx = canvas.getContext('2d');
weightComparisonChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Package A', 'Package B', 'Package C'],
datasets: [{
label: 'Volume',
data: [0, 0, 0],
backgroundColor: 'rgba(0, 74, 153, 0.6)',
borderColor: 'rgba(0, 74, 153, 1)',
borderWidth: 1
}, {
label: 'Dimensional Weight',
data: [0, 0, 0],
backgroundColor: 'rgba(40, 167, 69, 0.6)',
borderColor: 'rgba(40, 167, 69, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Weight / Volume Units'
}
}
},
plugins: {
legend: {
display: false // Legend is handled by custom div
}
}
}
});
}
}
function updateChart(volume, dimWeight, actualWeight) {
if (!weightComparisonChart) {
initializeChart();
}
if (weightComparisonChart) {
var labels = ['Current Package'];
var volumeData = [volume];
var dimWeightData = [dimWeight];
// Add example data points if needed for context, or just use current
// For simplicity, let's just show the current package
weightComparisonChart.data.labels = labels;
weightComparisonChart.data.datasets[0].data = volumeData;
weightComparisonChart.data.datasets[1].data = dimWeightData;
weightComparisonChart.update();
}
}
function formatNumber(num, decimals = 2) {
if (isNaN(num) || num === null || num === undefined) return '–';
return num.toFixed(decimals);
}
function updateResultsDisplay(volume, dimWeight, chargeableWeight, volumeUnit, weightUnit) {
document.getElementById('primaryResult').innerText = formatNumber(chargeableWeight) + ' ' + weightUnit;
document.getElementById('calculatedVolume').innerText = formatNumber(volume) + ' ' + volumeUnit;
document.getElementById('dimensionalWeight').innerText = formatNumber(dimWeight) + ' ' + weightUnit;
document.getElementById('chargeableWeight').innerText = formatNumber(chargeableWeight) + ' ' + weightUnit;
document.getElementById('tableVolume').innerText = formatNumber(volume) + ' ' + volumeUnit;
document.getElementById('tableDimWeight').innerText = formatNumber(dimWeight) + ' ' + weightUnit;
document.getElementById('tableActualWeight').innerText = formatNumber(parseFloat(document.getElementById('weight').value)) + ' ' + weightUnit;
document.getElementById('tableChargeableWeight').innerText = formatNumber(chargeableWeight) + ' ' + weightUnit;
updateChart(volume, dimWeight, parseFloat(document.getElementById('weight').value));
}
function convertUnits(value, fromUnit, toUnit, type) {
if (fromUnit === toUnit) return value;
var conversionRates = {
length: {
'in': 1,
'cm': 0.393701,
'ft': 12,
'm': 39.3701
},
weight: {
'lb': 1,
'kg': 2.20462
}
};
var factor = conversionRates[type][toUnit] / conversionRates[type][fromUnit];
return value * factor;
}
function calculateShippingCube() {
var length = parseFloat(document.getElementById('length').value);
var width = parseFloat(document.getElementById('width').value);
var height = parseFloat(document.getElementById('height').value);
var unit = document.getElementById('unit').value;
var weight = parseFloat(document.getElementById('weight').value);
var weightUnit = document.getElementById('weightUnit').value;
var dimFactor = parseFloat(document.getElementById('dimFactor').value);
var errors = false;
document.querySelectorAll('.error-message').forEach(function(el) { el.classList.remove('visible'); });
if (isNaN(length) || length <= 0) {
document.getElementById('lengthError').innerText = 'Please enter a valid positive number for length.';
document.getElementById('lengthError').classList.add('visible');
errors = true;
}
if (isNaN(width) || width <= 0) {
document.getElementById('widthError').innerText = 'Please enter a valid positive number for width.';
document.getElementById('widthError').classList.add('visible');
errors = true;
}
if (isNaN(height) || height <= 0) {
document.getElementById('heightError').innerText = 'Please enter a valid positive number for height.';
document.getElementById('heightError').classList.add('visible');
errors = true;
}
if (isNaN(weight) || weight < 0) { // Allow 0 weight for calculation purposes, though unlikely
document.getElementById('weightError').innerText = 'Please enter a valid non-negative number for weight.';
document.getElementById('weightError').classList.add('visible');
errors = true;
}
if (isNaN(dimFactor) || dimFactor <= 0) {
document.getElementById('dimFactorError').innerText = 'Please enter a valid positive number for dimensional factor.';
document.getElementById('dimFactorError').classList.add('visible');
errors = true;
}
if (errors) {
// Reset results if there are errors
document.getElementById('primaryResult').innerText = '–';
document.getElementById('calculatedVolume').innerText = '–';
document.getElementById('dimensionalWeight').innerText = '–';
document.getElementById('chargeableWeight').innerText = '–';
document.getElementById('tableVolume').innerText = '–';
document.getElementById('tableDimWeight').innerText = '–';
document.getElementById('tableActualWeight').innerText = '–';
document.getElementById('tableChargeableWeight').innerText = '–';
updateChart(0, 0, 0);
return;
}
// Convert dimensions to a common base unit (e.g., inches) for volume calculation
var lengthInches = convertUnits(length, unit, 'in', 'length');
var widthInches = convertUnits(width, unit, 'in', 'length');
var heightInches = convertUnits(height, unit, 'in', 'length');
// Calculate volume in cubic inches
var volumeInCubicInches = lengthInches * widthInches * heightInches;
// Convert actual weight to a common base unit (e.g., pounds)
var actualWeightPounds = convertUnits(weight, weightUnit, 'lb', 'weight');
// Determine the dimensional factor based on the *output* unit desired for dimensional weight.
// We want dimensional weight in the same unit as actual weight.
var targetWeightUnit = weightUnit; // e.g., 'lb' or 'kg'
var dimFactorForCalculation;
var volumeUnitForDisplay = 'in³'; // Default to cubic inches for calculation clarity
if (targetWeightUnit === 'lb') {
volumeUnitForDisplay = 'in³';
// If the input unit is metric, we need to convert the input dimensions to inches first
// and use the imperial dim factor. If input is imperial, use the provided dim factor.
if (unit === 'cm' || unit === 'm' || unit === 'ft') {
// Use a standard imperial factor if input was metric, assuming user wants lb/in³ comparison
dimFactorForCalculation = 139; // Standard imperial factor
} else { // Input unit is inches
dimFactorForCalculation = dimFactor;
}
// Ensure dimFactor is in lb/in³ if target is lb
if (document.getElementById('unit').value !== 'in' && targetWeightUnit === 'lb') {
// If input dimensions were metric, we already converted them to inches.
// The provided dimFactor might be metric. We need to ensure it's compatible.
// This logic gets complex. A simpler approach: always convert volume to cubic inches
// and use the imperial dim factor if target weight is lb.
// If the user provided a metric dim factor with imperial units, it's an error.
// For now, assume the user provides the correct dim factor for their units.
// Let's refine: If target is lb, we need dim factor in lb/in^3.
// If user input unit is 'in', use provided dimFactor.
// If user input unit is 'cm', 'm', 'ft', we need to convert the provided dimFactor.
// This is complex. Let's simplify: Assume user provides the correct factor for their units.
// We will convert volume to the unit implied by the dim factor.
// Let's assume the provided dimFactor is for the *input* units.
// Example: User inputs cm, selects lb. DimFactor is 5000 kg/cm³.
// We need to convert volume (cm³) to in³ and dimFactor (kg/cm³) to lb/in³.
// This requires careful unit conversion.
// Simpler approach: Convert everything to a base unit (inches, pounds)
// and use a standard imperial dim factor if needed.
// If user selected 'lb' as weight unit, we'll use 139 as default if not provided correctly.
if (dimFactor === 5000 || dimFactor === 6000) { // Likely metric factor
dimFactorForCalculation = 139; // Default imperial factor
volumeUnitForDisplay = 'in³';
} else {
dimFactorForCalculation = dimFactor; // Assume it's already imperial
volumeUnitForDisplay = 'in³';
}
} else {
dimFactorForCalculation = dimFactor;
volumeUnitForDisplay = 'in³';
}
} else { // targetWeightUnit === 'kg'
volumeUnitForDisplay = 'cm³';
// If input unit is imperial, convert dimensions to cm first.
if (unit === 'in' || unit === 'ft') {
// Use a standard metric factor if input was imperial
dimFactorForCalculation = 5000; // Standard metric factor
} else { // Input unit is metric (cm or m)
dimFactorForCalculation = dimFactor;
}
// Ensure dimFactor is in kg/cm³ if target is kg
if (document.getElementById('unit').value !== 'cm' && targetWeightUnit === 'kg') {
// Similar complexity as above. Assume user provides correct factor.
// If user selected 'kg' as weight unit, we'll use 5000 as default.
if (dimFactor === 139 || dimFactor === 166) { // Likely imperial factor
dimFactorForCalculation = 5000; // Default metric factor
volumeUnitForDisplay = 'cm³';
} else {
dimFactorForCalculation = dimFactor;
volumeUnitForDisplay = 'cm³';
}
} else {
dimFactorForCalculation = dimFactor;
volumeUnitForDisplay = 'cm³';
}
}
// Recalculate volume and weights based on the target units for display
var finalVolume, finalDimWeight, finalChargeableWeight;
var finalWeightUnit = weightUnit; // Use the user's selected weight unit
// Calculate volume in the unit implied by the dimensional factor
var volume;
var lengthForVol, widthForVol, heightForVol;
var volUnitStr = "";
if (dimFactorForCalculation === 139 || dimFactorForCalculation === 166) { // Imperial context (lb/in³)
volumeUnitForDisplay = 'in³';
lengthForVol = convertUnits(length, unit, 'in', 'length');
widthForVol = convertUnits(width, unit, 'in', 'length');
heightForVol = convertUnits(height, unit, 'in', 'length');
volume = lengthForVol * widthForVol * heightForVol;
finalWeightUnit = 'lb'; // Force to lb if using imperial factor
} else { // Metric context (kg/cm³ or kg/m³)
volumeUnitForDisplay = 'cm³';
lengthForVol = convertUnits(length, unit, 'cm', 'length');
widthForVol = convertUnits(width, unit, 'cm', 'length');
heightForVol = convertUnits(height, unit, 'cm', 'length');
volume = lengthForVol * widthForVol * heightForVol;
finalWeightUnit = 'kg'; // Force to kg if using metric factor
}
// Ensure the final weight unit matches the user's selection if possible, otherwise use the derived unit
if (weightUnit !== finalWeightUnit) {
// If user selected kg but we derived lb, convert actual weight to kg
if (weightUnit === 'kg' && finalWeightUnit === 'lb') {
actualWeightPounds = convertUnits(weight, weightUnit, 'lb', 'weight'); // Convert user's input to lb
weight = convertUnits(actualWeightPounds, 'lb', 'kg', 'weight'); // Convert back to kg for display consistency
weightUnit = 'kg';
} else if (weightUnit === 'lb' && finalWeightUnit === 'kg') {
// If user selected lb but we derived kg, convert actual weight to lb
actualWeightPounds = convertUnits(weight, weightUnit, 'kg', 'weight'); // Convert user's input to kg
weight = convertUnits(actualWeightPounds, 'kg', 'lb', 'weight'); // Convert back to lb for display consistency
weightUnit = 'lb';
}
// Update the display units if they changed
document.getElementById('weightUnit').value = weightUnit;
finalWeightUnit = weightUnit;
}
// Calculate dimensional weight using the determined volume and factor
var dimensionalWeight = volume / dimFactorForCalculation;
// Convert dimensional weight to the final weight unit if necessary
if (finalWeightUnit === 'lb') {
dimensionalWeight = convertUnits(dimensionalWeight, 'kg', 'lb', 'weight'); // Assuming dimFactor implies kg/cm³ initially
} else { // kg
dimensionalWeight = convertUnits(dimensionalWeight, 'lb', 'kg', 'weight'); // Assuming dimFactor implies lb/in³ initially
}
// Ensure actual weight is in the final weight unit for comparison
var actualWeightForComparison = convertUnits(weight, document.getElementById('weightUnit').value, finalWeightUnit, 'weight');
// Determine chargeable weight
var chargeableWeight = Math.max(actualWeightForComparison, dimensionalWeight);
// Update results display
updateResultsDisplay(volume, dimensionalWeight, chargeableWeight, volumeUnitForDisplay, finalWeightUnit);
}
function resetCalculator() {
document.getElementById('length').value = '';
document.getElementById('width').value = '';
document.getElementById('height').value = '';
document.getElementById('unit').value = 'in';
document.getElementById('weight').value = '';
document.getElementById('weightUnit').value = 'lb';
document.getElementById('dimFactor').value = '139'; // Reset to common default
document.querySelectorAll('.error-message').forEach(function(el) { el.classList.remove('visible'); });
// Reset results display
document.getElementById('primaryResult').innerText = '–';
document.getElementById('calculatedVolume').innerText = '–';
document.getElementById('dimensionalWeight').innerText = '–';
document.getElementById('chargeableWeight').innerText = '–';
document.getElementById('tableVolume').innerText = '–';
document.getElementById('tableDimWeight').innerText = '–';
document.getElementById('tableActualWeight').innerText = '–';
document.getElementById('tableChargeableWeight').innerText = '–';
if (weightComparisonChart) {
weightComparisonChart.data.labels = ['Package A', 'Package B', 'Package C'];
weightComparisonChart.data.datasets[0].data = [0, 0, 0];
weightComparisonChart.data.datasets[1].data = [0, 0, 0];
weightComparisonChart.update();
}
}
function copyResults() {
var primaryResult = document.getElementById('primaryResult').innerText;
var calculatedVolume = document.getElementById('calculatedVolume').innerText;
var dimensionalWeight = document.getElementById('dimensionalWeight').innerText;
var chargeableWeight = document.getElementById('chargeableWeight').innerText;
var formula = "Formula Used: Volume = L×W×H; Dimensional Weight = (L×W×H) / DF; Chargeable Weight = MAX(Actual Weight, Dimensional Weight)";
var resultsText = "Shipping Cube Calculator Results:\n\n";
resultsText += "Primary Result (Chargeable Weight): " + primaryResult + "\n";
resultsText += "Calculated Volume: " + calculatedVolume + "\n";
resultsText += "Dimensional Weight: " + dimensionalWeight + "\n";
resultsText += "Chargeable Weight: " + chargeableWeight + "\n";
resultsText += "\nKey Assumptions:\n";
resultsText += "Actual Weight: " + document.getElementById('weight').value + " " + document.getElementById('weightUnit').value + "\n";
resultsText += "Dimensions: " + document.getElementById('length').value + "x" + document.getElementById('width').value + "x" + document.getElementById('height').value + " " + document.getElementById('unit').value + "\n";
resultsText += "Dimensional Factor: " + document.getElementById('dimFactor').value + "\n";
resultsText += "\n" + formula;
navigator.clipboard.writeText(resultsText).then(function() {
// Optionally provide feedback to user
var btn = document.querySelector('.btn-copy');
var originalText = btn.innerText;
btn.innerText = 'Copied!';
setTimeout(function() {
btn.innerText = originalText;
}, 1500);
}).catch(function(err) {
console.error('Could not copy text: ', err);
alert('Failed to copy results. Please copy manually.');
});
}
function toggleFaq(element) {
var parent = element.parentElement;
parent.classList.toggle('open');
}
// Initial chart setup and calculation on load if inputs have default values
document.addEventListener('DOMContentLoaded', function() {
initializeChart();
// Trigger initial calculation if default values are set and meaningful
// For now, we'll wait for user input or explicit calculate button press.
// If you want auto-calculation on load, uncomment the line below and ensure defaults are set.
// calculateShippingCube();
});
// Add event listeners for real-time updates (optional, can be resource intensive)
document.getElementById('length').addEventListener('input', calculateShippingCube);
document.getElementById('width').addEventListener('input', calculateShippingCube);
document.getElementById('height').addEventListener('input', calculateShippingCube);
document.getElementById('unit').addEventListener('change', calculateShippingCube);
document.getElementById('weight').addEventListener('input', calculateShippingCube);
document.getElementById('weightUnit').addEventListener('change', calculateShippingCube);
document.getElementById('dimFactor').addEventListener('input', calculateShippingCube);