How to calculate Bounce Rate

Bounce rate is the share of sessions that leave after viewing a single page without interacting further.

Formula

Bounce rate = single-page sessions ÷ total sessions × 100

SQL query

This example assumes: page_views(session_id, page, viewed_at), sessions(id, source). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.

WITH per_session AS (
  SELECT session_id, COUNT(*) AS pages
  FROM page_views
  WHERE viewed_at >= CURRENT_DATE - 30
  GROUP BY session_id
)
SELECT s.source,
       COUNT(*) FILTER (WHERE p.pages = 1) * 100.0 / NULLIF(COUNT(*), 0) AS bounce_pct
FROM per_session p
JOIN sessions s ON s.id = p.session_id
GROUP BY s.source
ORDER BY bounce_pct DESC;

Common mistakes that make Bounce Rate wrong

  • Definitions differ between analytics tools (some count engagement events); compare like with like.
  • A blog post that fully answers the question will have a high bounce rate and still do its job.
  • Mixing landing pages with different purposes hides what is actually wrong.

Ask for Bounce Rate in plain English

Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.

  • What is the bounce rate by traffic source?
  • Which landing pages have the highest bounce rate?

Frequently asked questions

What is Bounce Rate?
Bounce rate is the share of sessions that leave after viewing a single page without interacting further.
How do you calculate Bounce Rate?
Bounce rate = single-page sessions ÷ total sessions × 100. The SQL example on this page shows the same calculation against a simple table.
What commonly goes wrong when calculating Bounce Rate?
Definitions differ between analytics tools (some count engagement events); compare like with like.