Standard 8-ball rules cover four decisions: who owns which group of balls, what counts as a foul, what a foul earns your opponent, and how a rack ends. This page checks each one against the actual code of 8 Ball Pool on this site, so what you read here is what the table does, not a generic summary of the sport.
The Basic Shape of a Rack
Two players share sixteen balls: seven in one color group, seven in the other, one black 8-ball, and a white cue ball. One player breaks, and once a colored ball is legally pocketed, that player is locked into that color group for the rest of the rack. From then on you must pocket only your own group, in any order, until all seven are gone โ then you shoot for the 8-ball. Pocket it legally and you win the rack. Pocket it early, on a foul, or pocket the cue ball on the same stroke, and you lose it instead.
On an American table the two groups are solids (1 through 7) and stripes (9 through 15). This version uses the British-style colors instead: seven red balls and seven yellow balls, with the same rules for who owns which group.
That's the sport. The rest of this page is about how 8 Ball Pool enforces โ and in a few places simplifies โ those exact mechanics.
Table Setup and the Break
Every rack starts from the same fixed layout, with the 8-ball in the middle of the triangle. Nothing checks whether the break was "legal" in the tournament sense: no rule about balls crossing the head string, no re-rack after a weak break. The break is judged by the same foul logic as every other shot, described below.

How Groups Get Assigned (the Open Table)
Officially, the table stays open until someone legally pockets a ball from one of the two groups โ a foul while doing it shouldn't decide anything. This game assigns the group the instant a red or yellow ball drops, before it has even checked whether that shot was legal: the color lock happens while balls are still settling, and the foul check only runs afterward, once everything stops moving. In practice a shot that scratches the cue ball, or hits the wrong ball first, can still lock you into a color if a colored ball happened to fall โ the table doesn't stay open just because the shot was a foul.
Once you're locked into red or yellow, every ball you're allowed to legally pocket has to match that color โ the code checks it ball by ball, not just "did you pocket the right count."

What Counts as a Foul
Every shot is judged on two things: what the cue ball touched first, and which balls ended up in pockets.
- No first contact at all. If the cue ball doesn't touch anything, the turn is automatically invalid โ you can't "safety" your way to a clean turn by missing everything.
- Wrong first contact. On an open table, hitting the 8-ball first is a foul; any other first contact is fine. Once you own a color, your first contact has to be your own color โ unless your group is already cleared, in which case the 8-ball becomes the only legal first contact.
- Pocketing the cue ball is always a foul. The scratch check isn't a special case โ it falls out naturally, because the cue ball's color never matches a player's assigned group, so any pocketed-ball list that includes the white ball fails the legality check.
- Pocketing the wrong color is a foul, the same way โ every ball you sank that turn has to match your group, or match the 8-ball once your group is empty.
One thing worth flagging clearly: this version does not enforce live pool's "rail after contact" rule (no ball pocketed means the cue ball or an object ball must reach a cushion, or it's a foul). Here, as long as the cue ball touches a legal ball first, a shot that pockets nothing and never reaches a rail still counts as a clean, valid turn โ a soft tap that barely nudges your own ball is legal, even though a real-table referee would call it a foul.
Ball in Hand
Any foul in this game hands the incoming player "ball in hand" โ they place the cue ball themselves instead of shooting from wherever it stopped. The rule that triggers it is blunt: the moment a turn is marked invalid, the very next turn starts with ball in hand, no separate distinction between a scratch, a wrong-ball foul, or a no-contact foul.
Placement itself is generous: you can drop the cue ball anywhere on the table that doesn't overlap another ball and stays inside the cushions โ full stop. There's no "kitchen" or behind-the-head-string restriction, not even for a foul on the break itself. In official 8-ball, ball-in-hand after a break foul is often restricted to behind the head string; this version treats every foul the same way and opens the whole table.
Winning and Losing on the 8-Ball
Each player's progress is tracked as a running count: eight, minus however many of your own balls are still on the table, minus one for the 8-ball if it hasn't been pocketed yet. That count has to hit exactly seven โ your whole group cleared, 8-ball still up โ before the 8-ball becomes a legal first contact at all.
From there, three ways to end a rack all come out of the same handful of rule checks:
- Legal win: your group is cleared, you pocket only the 8-ball, and the cue ball stays up. Rack over, you win.
- Early 8-ball: pocketing the 8-ball before your count reaches seven ends the rack immediately, but the shot itself is always ruled a foul (the 8-ball's color never matches your still-incomplete group), so you lose the rack outright โ including if it happens on the break, when no group has even been assigned yet.
- 8-ball plus a scratch: if the cue ball goes down on the same stroke that pockets the 8-ball, the turn is invalid even if your group was already clear, and you lose.
- Scratch while on the 8-ball: once your group is cleared, sinking the cue ball ends the rack as a loss even if the 8-ball never moved. On many real tables that would only be a foul with ball in hand for your opponent; here it is game over.
There's no re-spot and no "win on the break" exception coded in โ pocketing the 8-ball always ends the rack instantly, and win or loss depends entirely on whether that one shot passed the foul check.
Controls: Aiming, Power, and the Shot
Aiming is a straight angle calculation: the cue stick's rotation is recalculated every single frame from the angle between the cue ball and your mouse pointer, so the stick tracks the cursor in real time with no separate "lock aim" step.
Power runs on a simple meter, not a pull-back gesture: hold W to add power, hold S to remove it, one unit per rendered frame, capped hard at 65. Charging from empty to full takes exactly 65 frames โ a little over one second at 60 frames per second. Left-click fires at whatever power and angle the stick holds that instant, and the stick sprite hides for half a second right after you strike.
The Physics Behind Every Shot
Every ball loses 2.08% of its speed each frame it moves, whether rolling freely, bouncing off a cushion, or colliding with another ball โ the code reuses that same 2.08% figure for friction and for collision loss. Below 0.05 pixels per frame, a ball is forced to a dead stop rather than crawling forever.
Running that decay curve forward gives concrete numbers. A shot at full power (65) rolls for 342 frames โ about 5.7 seconds โ covering roughly 3,058 pixels before it dies out. The table's playable width is only 1,386 pixels, so a full-power break carries more than twice the energy needed to cross the table; cushion geometry limits a break, not the cue ball running out of steam. Drifting the cue ball the roughly 610โ680 pixels from its break spot to the rack or the 8-ball, straight and unobstructed, only takes a power setting of 13 to 16 โ a fifth to a quarter of the maximum. Crossing the full 1,386-pixel width in a straight line needs a power setting of around 30, still under half the meter.
If judging how hard to strike a ball is the part you enjoy, Mini Golf is the other game on the site built around that same decision.
One Player vs. Two Players, and What the Difficulty Levels Actually Change
Two Players is a local, same-screen match: switching to it simply turns the built-in opponent off, and both people take turns with the same mouse and keyboard โ there's no networking involved anywhere in the game's code, so it isn't an online mode.
One Player adds a computer opponent with four named difficulties โ Easy, Medium, Hard, and Insane โ and what separates them isn't smarter aim, it's patience. Each difficulty is a number of practice shots the AI simulates on a private copy of the table before playing its real turn: 30 for Easy, 50 for Medium, 100 for Hard, 700 for Insane. Every simulated attempt is scored โ roughly +5,000 for a legal turn, +2,000 per pocketed ball, +50,000 for ending the rack in a win, and steep penalties of -3,000 for a foul and -50,000 for a loss, plus a tiny bonus for spreading the remaining balls apart that rarely outweighs those bigger numbers. Nine times out of ten the next attempt is a small random tweak to the best shot found so far; every tenth attempt restarts from a fully random power and angle, which keeps the search from getting stuck. Insane isn't reading the table better than Easy โ it just gets roughly 23 times more guesses in the same turn, and it only ever optimizes the shot directly in front of it, with no planning for where the cue ball ends up afterward.
Frequently Asked Questions
What happens if you scratch while shooting at the 8-ball?
The rack ends immediately and you lose it. Pocketing the cue ball on the same stroke that pockets the 8-ball always fails the game's legality check, regardless of whether the 8-ball itself went in cleanly.
Do you have to call your shot or your pocket?
No. The rules here only check what the cue ball touched first and which balls got pocketed โ there's no mechanic for calling a specific ball or pocket.
Can you place the cue ball anywhere after a foul?
Yes, anywhere that isn't overlapping another ball and stays inside the cushions, with no restricted zone โ even right after a foul on the break.
Is there a shot clock?
No. Nothing forces a shot within a set time โ you can leave the stick aimed indefinitely before clicking.
What does "Insane" difficulty actually change?
The number of practice shots the AI simulates before playing for real: 30 on Easy, up to 700 on Insane. It's a search-budget increase, not a different strategy โ the scoring is identical at every level.
The fastest way to see all this in action is to open 8 Ball Pool and take a break shot. The site's guide library covers the same code-first approach for the rest of the catalog, and the case for browser games explains why these guides exist.