Net Promoter Score (NPS) Calculator
The Net Promoter Score (NPS) is a customer loyalty metric that measures the likelihood of customers recommending a company's products or services to others. It's a powerful tool for understanding customer satisfaction and identifying areas for improvement.
The NPS is calculated based on a single question: "On a scale of 0 to 10, how likely are you to recommend [Company/Product/Service] to a friend or colleague?"
Respondents are categorized into three groups:
- Promoters (9-10): Loyal enthusiasts who will keep buying and refer others, fueling growth.
- Passives (7-8): Satisfied but unenthusiastic customers who are vulnerable to competitive offerings.
- Detractors (0-6): Unhappy customers who can damage your brand and impede growth through negative word-of-mouth.
The NPS formula is simple:
NPS = % Promoters – % Detractors
The resulting score ranges from -100 to +100.
.calculator-container {
font-family: 'Arial', sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #e0e0e0;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.calculator-title {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.calculator-description {
margin-bottom: 25px;
color: #555;
line-height: 1.6;
}
.calculator-description ul {
margin-top: 10px;
padding-left: 20px;
}
.calculator-description li {
margin-bottom: 8px;
}
.calculator-form {
display: grid;
grid-template-columns: 1fr;
gap: 15px;
}
.form-group {
display: flex;
flex-direction: column;
}
.form-group label {
margin-bottom: 8px;
font-weight: bold;
color: #444;
}
.form-group input[type="number"] {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
}
.btn {
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1.1rem;
transition: background-color 0.3s ease;
justify-self: center; /* Center button in grid */
}
.btn:hover {
background-color: #0056b3;
}
.calculator-result {
margin-top: 25px;
padding: 15px;
background-color: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 5px;
text-align: center;
font-size: 1.2rem;
font-weight: bold;
color: #333;
}
.calculator-result span {
color: #007bff;
}
function calculateNPS() {
var totalRespondents = parseFloat(document.getElementById("totalRespondents").value);
var promoters = parseFloat(document.getElementById("promoters").value);
var passives = parseFloat(document.getElementById("passives").value);
var detractors = parseFloat(document.getElementById("detractors").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(totalRespondents) || isNaN(promoters) || isNaN(passives) || isNaN(detractors)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (totalRespondents <= 0 || promoters < 0 || passives < 0 || detractors = 0 && npsScore <= 30) {
interpretation = "
Good: Indicates a healthy customer base with more promoters than detractors.";
} else if (npsScore > 30 && npsScore <= 70) {
interpretation = "
Great: Shows strong customer loyalty and advocacy.";
} else if (npsScore > 70) {
interpretation = "
Excellent: Represents world-class customer loyalty.";
} else if (npsScore < 0) {
interpretation = "
Needs Improvement: A negative score indicates significant issues with customer satisfaction.";
} else { // NPS of 0
interpretation = "
Neutral: Suggests an equal balance of promoters and detractors.";
}
resultDiv.innerHTML = "Your Net Promoter Score (NPS) is:
" + npsScore.toFixed(2) + "" + interpretation;
}