The Net Promoter Score (NPS) is a widely used metric for measuring customer loyalty and satisfaction. It's based on a single question: "On a scale of 0 to 10, how likely are you to recommend our company/product/service to a friend or colleague?"
Respondents are categorized into three groups:
Promoters (Score 9-10): Loyal enthusiasts who will keep buying and refer others, fueling growth.
Passives (Score 7-8): Satisfied but unenthusiastic customers who are vulnerable to competitive offerings.
Detractors (Score 0-6): Unhappy customers who can damage your brand and impede growth through negative word-of-mouth.
The NPS is calculated by subtracting the percentage of Detractors from the percentage of Promoters:
NPS = % Promoters – % Detractors
The resulting score can range from -100 to +100. A positive NPS indicates a healthy customer base with more promoters than detractors.
NPS Calculator
function calculateNPS() {
var totalResponses = parseFloat(document.getElementById("totalResponses").value);
var promoters = parseFloat(document.getElementById("promoters").value);
var detractors = parseFloat(document.getElementById("detractors").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(totalResponses) || isNaN(promoters) || isNaN(detractors)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (totalResponses <= 0) {
resultDiv.innerHTML = "Total number of respondents must be greater than zero.";
return;
}
if (promoters < 0 || detractors totalResponses) {
resultDiv.innerHTML = "The sum of promoters and detractors cannot exceed the total number of respondents.";
return;
}
var percentagePromoters = (promoters / totalResponses) * 100;
var percentageDetractors = (detractors / totalResponses) * 100;
var nps = percentagePromoters – percentageDetractors;
resultDiv.innerHTML = "Your Net Promoter Score (NPS) is: " + nps.toFixed(2);
}