This article is free to read. Creating a lesson uses your daily or stored credits; review the language and settings before starting.
How does an ad blocker work?
Quick answer
An ad blocker is software that checks every resource your browser tries to load against a filter list of known ad servers and URL patterns. Requests that match are blocked before they are sent, and ads already in the page are hidden with CSS, so they never appear.
An ad blocker works by intercepting network requests that browsers make for advertising content and blocking those that match known ad-serving patterns. It relies on filter lists that map domains, URLs and element signatures to rules, so ads never load or render.
Step by step
- The browser starts loading a webpage and discovers resources to fetch, including scripts, images and iframes.
- The ad blocker examines each request's URL and domain against its filter lists of known ad sources.
- If a request matches a blocking rule, the blocker cancels it so the ad content is never downloaded.
- For ads written directly into the page's HTML, the blocker applies CSS rules to hide those elements.
- The page finishes rendering without the blocked ads, and the filter lists update periodically to catch new ad servers.
Key things to understand
- When a page loads, the browser requests resources such as images, scripts and iframes from many servers.
- An ad blocker inspects each outgoing request against a filter list of known ad domains and URL patterns.
- Requests that match a blocking rule are stopped before they leave the browser, so the ad never arrives.
- For ads embedded directly in a page's HTML, the blocker hides the element using CSS rules after parsing.
- Filter lists are maintained by communities and updated regularly to keep pace with new ad servers.
Labelled diagram
- Page load
Browser begins fetching HTML and discovers external resources like scripts and images.
- Request check
Ad blocker compares each resource URL against filter lists of known ad domains.
- Block or allow
Matching requests are cancelled; non-matching requests proceed to the network.
- Hide in-page ads
CSS rules hide ad elements that are part of the page's own HTML.
- Render page
The page displays without the blocked advertising content.
Real-world examples
- On a news website, a banner ad loaded from a third-party ad network is blocked because its domain appears in a filter list.
- A video platform's pre-roll ad, served from a separate ad server, is stopped before the video player can request it.
- A pop-up window that would open from an ad script is prevented because the script itself is never loaded.
- A sponsored post that is part of the page's own HTML may still appear unless the filter list includes a rule for that specific element.
Common mistake
✗ Myth: Ad blockers delete ads after they have already loaded on the page.
✓ Fact: Most ad blockers prevent ad requests from being sent in the first place, so the ad content is never downloaded. Only ads embedded directly in the page's HTML are hidden after loading, using CSS.
People also ask
How does an ad blocker know what to block?
Do ad blockers work on all websites?
Can I get in trouble for using an ad blocker?
Does an ad blocker slow down my browser?
Can websites detect that I am using an ad blocker?
Do ad blockers stop all ads?
Are ad blockers legal?
Part of the guide: How the Internet Works →

