In telecommunications and computer networking, the terms "Bandwidth" and "Data Rate" are often used interchangeably, but they represent distinct physical concepts. This calculator uses the Shannon-Hartley Theorem to determine the maximum theoretical data rate (Channel Capacity) that can be transmitted over a communication channel with a specific bandwidth and noise level.
C = B × log₂(1 + S/N)
Where:
C (Channel Capacity): The maximum theoretical data rate in bits per second (bps).
B (Bandwidth): The frequency range of the channel in Hertz (Hz).
S/N (Signal-to-Noise Ratio): The ratio of signal power to noise power (linear scale, not dB).
Key Differences Explained
To visualize the difference, imagine a highway:
Bandwidth (Hz) is the width of the highway (number of lanes). A wider highway (higher bandwidth) can potentially carry more traffic.
Data Rate (bps) is the actual number of cars passing a point per second. This depends not just on the width of the road, but also on how fast the cars are moving and how tightly packed they are.
SNR (Signal-to-Noise Ratio) represents the road conditions. A high SNR means a clear, sunny day where cars can drive fast and close together. A low SNR means fog or potholes, requiring cars to space out and slow down to avoid accidents (errors).
How to Use This Calculator
Enter Bandwidth: Input the frequency range allocated for transmission. For example, a standard WiFi channel might be 20 MHz or 40 MHz.
Select Unit: Choose between Hz, kHz, MHz, or GHz.
Enter SNR: Input the signal quality. In most engineering contexts, this is measured in Decibels (dB). A value of 0 dB means signal equals noise. 30 dB is considered excellent for many wireless standards.
Result: The calculator provides the "Shannon Limit"—the absolute physical ceiling for data transfer speed under those conditions. Real-world systems (like WiFi 6, 5G, or Ethernet) strive to get close to this limit but rarely reach it due to overhead and hardware imperfections.
Spectral Efficiency
The result also displays Spectral Efficiency, measured in bits/s/Hz. This metric tells you how many bits of data you are squeezing into every Hertz of bandwidth. Advanced modulation schemes like QAM-256 or QAM-1024 require high SNR to achieve high spectral efficiency.
function calculateShannonLimit() {
// 1. Get input elements
var bwInput = document.getElementById("bandwidthInput");
var bwUnit = document.getElementById("bandwidthUnit");
var snrInput = document.getElementById("snrInput");
var snrUnit = document.getElementById("snrUnit");
var resultBox = document.getElementById("resultBox");
// 2. Parse values
var B = parseFloat(bwInput.value);
var B_multiplier = parseFloat(bwUnit.value);
var snrVal = parseFloat(snrInput.value);
// 3. Validation
if (isNaN(B) || B <= 0) {
alert("Please enter a valid positive number for Bandwidth.");
return;
}
if (isNaN(snrVal)) {
alert("Please enter a valid number for SNR.");
return;
}
// 4. Conversions
// Convert Bandwidth to Hz
var bandwidthHz = B * B_multiplier;
// Convert SNR to Linear Ratio
var snrLinear = 0;
if (snrUnit.value === "db") {
// Formula: Linear = 10^(dB/10)
snrLinear = Math.pow(10, snrVal / 10);
} else {
snrLinear = snrVal;
if (snrLinear = 1e9) {
return (bits / 1e9).toFixed(2) + " Gbps";
} else if (bits >= 1e6) {
return (bits / 1e6).toFixed(2) + " Mbps";
} else if (bits >= 1e3) {
return (bits / 1e3).toFixed(2) + " Kbps";
} else {
return bits.toFixed(0) + " bps";
}
}
function formatFreq(hz) {
if (hz >= 1e9) {
return (hz / 1e9).toFixed(2) + " GHz";
} else if (hz >= 1e6) {
return (hz / 1e6).toFixed(2) + " MHz";
} else if (hz >= 1e3) {
return (hz / 1e3).toFixed(2) + " kHz";
} else {
return hz.toFixed(0) + " Hz";
}
}
// 8. Update DOM
document.getElementById("resultRate").innerText = formatDataRate(capacityBits);
document.getElementById("resultEfficiency").innerText = efficiency.toFixed(2) + " bits/s/Hz";
document.getElementById("resultRawBw").innerText = formatFreq(bandwidthHz);
document.getElementById("resultLinearSnr").innerText = snrLinear.toFixed(4); // Show detailed linear ratio
// Show results
resultBox.style.display = "block";
}