Unemployment Rate Calculator
The unemployment rate is a key economic indicator that reflects the health of a nation's labor market. It is calculated by dividing the number of unemployed individuals by the total labor force (which includes both employed and unemployed individuals actively seeking work) and then multiplying by 100.
Total Labor Force:
Number of Unemployed Individuals:
Calculate Unemployment Rate
#unemployment-calculator {
font-family: sans-serif;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
max-width: 500px;
margin: 20px auto;
background-color: #f9f9f9;
}
#unemployment-calculator h2, #unemployment-calculator h3 {
text-align: center;
color: #333;
}
.input-section {
margin-bottom: 15px;
}
.input-section label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.input-section input[type="number"] {
width: calc(100% – 22px);
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
}
#unemployment-calculator button {
display: block;
width: 100%;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
#unemployment-calculator button:hover {
background-color: #0056b3;
}
#result {
margin-top: 25px;
padding: 15px;
border-top: 1px solid #eee;
background-color: #fff;
border-radius: 5px;
}
#result h3 {
margin-top: 0;
color: #444;
}
#unemploymentRateOutput {
font-size: 24px;
font-weight: bold;
color: #28a745;
text-align: center;
}
function calculateUnemploymentRate() {
var laborForceInput = document.getElementById("laborForce");
var unemployedInput = document.getElementById("unemployed");
var unemploymentRateOutput = document.getElementById("unemploymentRateOutput");
var laborForce = parseFloat(laborForceInput.value);
var unemployed = parseFloat(unemployedInput.value);
if (isNaN(laborForce) || isNaN(unemployed) || laborForce <= 0 || unemployed laborForce) {
unemploymentRateOutput.textContent = "Number of unemployed individuals cannot exceed the total labor force.";
return;
}
var unemploymentRate = (unemployed / laborForce) * 100;
unemploymentRateOutput.textContent = unemploymentRate.toFixed(2) + "%";
}