Sub topic 4
Reviews and ratings: volume, recency, and balance
This chapter assumes you can write basic HTML and CSS. It also assumes you know what a landing, product, and pricing page are, and what a conversion rate is. Testimonials are quotes the business picks. Reviews and ratings are a different kind of signal, because visitors expect them to include the good, the bad, and the ordinary. That expectation shapes how you collect, display, and summarize them.
What reviews and ratings are
A review is a written opinion from a customer, usually with a star score. A rating is the score alone, such as 4 out of 5 stars. An aggregate rating is the average of many ratings, shown together with the number of ratings, for example "4.6 from 212 reviews".
Visitors read these signals as a quick estimate of "how likely is this to go well for me?" They rarely compute anything. They glance at the score, the count, and a few recent comments.
The three dimensions: volume, recency, and balance
Three properties decide whether a rating display is believable. A high average alone is not enough.
Volume
Volume is how many reviews back the score. A 5.0 from 3 reviews is weaker evidence than a 4.6 from 212. Small samples swing wildly: one extra 1-star review moves a 3-review average by more than a full star.
Always show the count next to the score. A bare "4.8 ★" invites suspicion, because visitors cannot tell whether it rests on 5 reviews or 5,000.
If you have few reviews, you have these options:
- Show individual reviews rather than an average. Three detailed reviews persuade better than a thin average.
- Wait to show an aggregate until you have a meaningful number, often a few dozen.
- Ask recent customers for reviews through a post-purchase email, sent when the experience is fresh.
Recency
Recency is how recently the reviews were written. Products change, teams change, and a review from six years ago says little about today. Visitors often check dates before they trust a score.
Show the date on each review. Sort by "most recent" or offer a sort control. If your average comes from old reviews only, collect new ones before relying on it.
Balance
Balance is the spread of scores. A product with only 5-star reviews looks edited, even when it is not. Visitors often read the 3-star and 1-star reviews first, because those reveal the real trade-offs.
A rating distribution is a breakdown of how many reviews gave each star level. It is one of the most useful elements you can show.
| Stars | Count | Share |
|---|---|---|
| 5 | 150 | 71% |
| 4 | 40 | 19% |
| 3 | 12 | 6% |
| 2 | 5 | 2% |
| 1 | 5 | 2% |
This distribution tells a visitor that most people are happy, a few are not, and nothing is hidden. A mix like this is more believable than a perfect score.
How the average is computed
The mean is simple, but you should know how it behaves. This script computes the average and the distribution from a list of scores.
from collections import Counter
scores = [5] * 150 + [4] * 40 + [3] * 12 + [2] * 5 + [1] * 5
count = len(scores)
average = sum(scores) / count
distribution = Counter(scores)
print(f"Average: {average:.1f} from {count} reviews")
for stars in range(5, 0, -1):
n = distribution.get(stars, 0)
print(f"{stars} stars: {n} ({n / count:.0%})")Running it prints an average of 4.6 from 212 reviews, followed by the shares in the table above. Compute the average from the real data every time. Do not hard-code it in a template, because the displayed number would drift away from the reviews underneath it.
Small samples and ranking
If you sort products by rating, a new product with one 5-star review would outrank an established one with 4.7 from 800 reviews. Sites handle this by weighting the score by volume, for example with a Bayesian average, which pulls scores with few reviews toward the overall mean. You do not need to implement that for a single product page, but be aware of it when building a listing page with many products.
Displaying ratings on the page
A good rating display has these parts:
- The average, as a number and as stars.
- The count, as a link to the full reviews.
- A distribution, at least on the product or reviews page.
- Individual reviews with the reviewer's name or first name and initial, the date, and the score.
- A sort or filter control for recency and star level.
Do not communicate the score with star icons alone. Screen reader users and anyone who cannot see the icons need the text.
<div class="rating-summary">
<p class="rating-value">
<span aria-hidden="true">★★★★☆</span>
<span class="visually-hidden">Rated 4.6 out of 5</span>
4.6
</p>
<p><a href="#reviews">212 reviews</a></p>
</div>The stars are hidden from assistive technology with aria-hidden="true", and a text equivalent is provided in a visually hidden element. You need a utility class for that element.
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}Individual reviews
Each review is a self-contained piece of content, so article is a good fit.
<article class="review">
<h3>Sturdy and quiet</h3>
<p class="review-meta">
<span class="visually-hidden">Rated 5 out of 5</span>
<span aria-hidden="true">★★★★★</span>
Dana O. · <time datetime="2026-10-14">October 14, 2026</time>
· Verified purchase
</p>
<p>Easy to assemble and it does not wobble at standing height.</p>
</article>The time element carries a machine-readable date. The "Verified purchase" label is only honest if your system actually checks that the reviewer bought the product. Chapter material on authenticity and legal limits covers this in more detail.
Collecting reviews responsibly
How you ask determines how believable the results are.
- Ask every customer, not only those you expect to be happy. Asking only satisfied customers biases the score upward, and some jurisdictions treat this as misleading.
- Send the request at the right moment. For a physical product, that is after delivery plus enough time to use it. For software, it is after the customer has completed a real task.
- Make leaving a review easy: one link, no forced account creation if you can avoid it.
- Do not offer rewards that depend on a positive score. If you offer an incentive for reviewing at all, it must not depend on what the review says, and it should be disclosed.
Handling negative reviews
Negative reviews are part of the signal. Removing them damages the balance that makes the rest believable.
- Leave critical reviews published unless they break clearly stated rules, such as abuse, personal data, or content that is not about the product.
- Reply publicly, briefly, and factually. A reply that acknowledges the problem and states what you did shows future visitors how you act when something goes wrong.
- Use the feedback. A repeated complaint is information about the product.
Where reviews come from: first-party and third-party
Reviews can be collected on your own site (first-party) or shown from an independent platform (third-party), such as a marketplace or review site.
| Source | Strength | Weakness |
|---|---|---|
| First-party, on your site | You control the layout and can add verification and structured data | Visitors may suspect you filter them |
| Third-party platform | Seen as independent, with its own moderation | Less control over design, and you cannot edit or remove reviews |
Many sites use both: collected reviews on the product page and a link or widget showing the independent platform's score. If you show a third-party score, it must match what that platform currently shows. Do not round a 4.3 up to 4.5, and do not quote an old figure.
A short flow for the whole process
The diagram shows how a review travels from a purchase to the page. Each step is a chance to keep the signal honest.
The key branch is the check at step D. The only reason to reject a review should be a rule that visitors can read, and the star level should never be one of them.
Common errors
- Showing an average without a count. The number cannot be judged.
- Displaying old reviews only. The score may no longer describe the product.
- Showing only 5-star reviews. Visitors assume the rest were filtered.
- Hard-coding the rating. The page drifts out of sync with the data.
- Using stars with no text alternative. Screen reader users get no information.
- Rounding up. A 4.3 shown as 4.5 is a false claim, not a design choice.
- Mixing up product and company reviews. A rating for the company's support should not be presented as a rating for one product.
Summary of practice
Show the score, the count, the dates, and the spread. Collect from all customers, publish the criticism, and calculate numbers from the real data. When those things hold, the rating works as evidence rather than decoration.
Exercise
A product page shows "★ 5.0" next to the buy button. It is based on 4 reviews, all written in 2021, and the page shows no count or dates. Name the three properties from this chapter that are weak or missing, and say what you would change for each.
Show answer
Volume: only 4 reviews, and no count shown. Show the count, and either show the individual reviews instead of an average or wait to show an aggregate until there are more. Recency: all reviews are from 2021 and no dates are shown. Show dates and collect new reviews from recent customers. Balance: every score is 5 and there is no distribution. Ask all recent customers for reviews, publish the mixed ones, and show the distribution once there are enough reviews to make it meaningful.
Exercise
Using the Python script in this chapter as a model, a product has 30 reviews: 18 five-star, 6 four-star, 3 three-star, 2 two-star, and 1 one-star. What is the average to one decimal place, and what should the visible text on the page say?
Show answer
The total is 18×5 + 6×4 + 3×3 + 2×2 + 1×1 = 90 + 24 + 9 + 4 + 1 = 128. Divided by 30, the average is 4.27, which rounds to 4.3. The page should say something like "Rated 4.3 out of 5 from 30 reviews", with the count linking to the reviews, and the text should be available to screen readers.