The Net Promoter Score (NPS) is a customer loyalty metric used to gauge customer satisfaction and predict business growth. It's 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 based on their score:
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.
How to Calculate NPS
The NPS is calculated by subtracting the percentage of Detractors from the percentage of Promoters. Passives are not included in the final calculation but represent a significant segment to monitor.
Formula:
NPS = (% Promoters) – (% Detractors)
To calculate these percentages, you first need the total number of respondents.
Steps:
Sum the number of Promoters, Passives, and Detractors to get the Total Respondents.
Calculate the Percentage of Promoters: (Number of Promoters / Total Respondents) * 100
Calculate the Percentage of Detractors: (Number of Detractors / Total Respondents) * 100
Subtract the Percentage of Detractors from the Percentage of Promoters to get the NPS.
The NPS score ranges from -100 to +100. A positive NPS indicates more promoters than detractors, which is generally a good sign of customer loyalty.
NPS Score Interpretation:
+70: World-class.
+30 to +69: Excellent.
+0 to +29: Good.
-0 to -29: Below Average.
-100 to -30: Poor.
Regularly tracking NPS helps businesses understand customer sentiment, identify areas for improvement, and measure the impact of changes over time.
function calculateNPS() {
var promotersInput = document.getElementById("promoters");
var passivesInput = document.getElementById("passives");
var detractorsInput = document.getElementById("detractors");
var resultDiv = document.getElementById("result");
var promoters = parseInt(promotersInput.value);
var passives = parseInt(passivesInput.value);
var detractors = parseInt(detractorsInput.value);
// Validate inputs
if (isNaN(promoters) || isNaN(passives) || isNaN(detractors) || promoters < 0 || passives < 0 || detractors < 0) {
resultDiv.innerHTML = "Invalid input. Please enter non-negative numbers.";
resultDiv.style.backgroundColor = "#dc3545"; /* Red for error */
return;
}
var totalRespondents = promoters + passives + detractors;
if (totalRespondents === 0) {
resultDiv.innerHTML = "0 Please enter at least one respondent.";
resultDiv.style.backgroundColor = "var(–success-green)"; /* Green when score is 0 but valid */
return;
}
var percentagePromoters = (promoters / totalRespondents) * 100;
var percentageDetractors = (detractors / totalRespondents) * 100;
var nps = percentagePromoters – percentageDetractors;
// Ensure NPS is displayed as a whole number (or with reasonable precision)
var formattedNPS = nps.toFixed(1); // Display one decimal place
// Adjust color based on score
var resultBackgroundColor = "var(–success-green)";
if (nps < 0) {
resultBackgroundColor = "#ffc107"; // Yellow for negative scores
}
if (nps = 70) {
resultBackgroundColor = "#17a2b8"; // Blue for world-class scores
}
resultDiv.innerHTML = formattedNPS + "NPS Score";
resultDiv.style.backgroundColor = resultBackgroundColor;
}