Skip to main content

The bed & breakfast (30-day) rule, explained

This is the rule people find most surprising. To work out your gain, HMRC has to pair your sale with the cost of specific shares you bought — this pairing is called matching, and which purchase a sale is matched to decides which cost you subtract. If you sell a share and then buy the same share back within 30 days, HMRC does not match that sale against your pool. Instead it matches the sale against the buy-back — which usually means a much smaller gain or loss than you expected.

When you sell shares, HMRC has to decide which of your purchases the sold shares came from — because that sets the cost. It always works through three rules in this fixed order, top to bottom, until the whole sale is accounted for:

  1. Same-day rule shares of the same company you bought on the very day you sold.
  2. Bed & breakfast (30-day) rule — this page shares you bought back in the 30 days after the sale.
  3. Section 104 pool everything left over, at your blended average cost.

Where the odd name comes from

Years ago, investors would sell shares on the last day of the tax year to “use up” a gain or crystallise a loss, then buy them straight back the next morning — selling at “bed” time and repurchasing at “breakfast”. It changed their tax position without really changing what they owned. HMRC closed that down with a 30-day rule, and the nickname stuck.

The idea in one sentence

If you sell shares and buy the same shares back within the next 30 days, HMRC matches your sale to that buy-back first — not to your pool. Because the sale price and the buy-back price are usually close, your gain (or loss) ends up small.

Our worked example

Our investor has held 1,000 Lloyds (LLOY) shares since 2025 at £0.40 each. They sell 500, then have second thoughts and buy 500 back 19 days later at a slightly lower price. Note the order: the sale comes first, the buy-back comes after. This is the exact example the button below loads into the calculator.

DateTypeSymbolQtyPriceFeesCcyFX RateGBP Value
1 Jan 2025BuyLLOY1,000£0.40£0.00GBP1.00£400.00
1 May 2026SellLLOY500£0.50£0.00GBP1.00£250.00
20 May 2026BuyLLOY500£0.46£0.00GBP1.00£230.00

Working it out, step by step

The starting holding

From the 2025 purchase, the pool holds 1,000 LLOY shares that cost £400.00 in total — an average of £0.40 each. Hold that thought; the surprise is that the sale won't touch it.

Section 104 pool now holds

1,000
shares
£400.00
total cost
£0.40
average per share

The long-term holding at £0.40 average. Keep an eye on it: if the sale used the pool, the cost would be 500 × £0.40 = £200.00 — but, as we'll see, the bed & breakfast rule means it doesn't.

The sale on 1 May 2026

They sell 500 LLOY at £0.50, receiving £250. On its own, this looks like a £50.00 gain against the pool. But before we conclude anything, HMRC makes us look forward 30 days to see whether any shares were bought back.

Proceeds from the sale
500 shares × £0.50 = £250.00

Don't reach for the pool yet

The same-day and 30-day rules always get checked first. We have to ask: in the 30 days after 1 May, did this investor buy LLOY back? If yes, that purchase — not the pool — is the cost of the sale.

The buy-back on 20 May — within the window

On 20 May 2026 they buy 500 LLOY back at £0.46 (£230.00). That's 19 days after the sale — comfortably inside the 30-day window. So the bed & breakfast rule matches the 1 May sale to this buy-back, and its cost becomes the cost of the sale.

Proceeds (from step 2)
500 × £0.50 = £250.00
Allowable cost (the buy-back, not the pool)
500 × £0.46 = £230.00
Gain
£250.00 − £230.00 = £20.00

The window in detail

The window is the 30 days following the sale (not before it). If several buy-backs fall inside it, the earliest is used first. A buy on day 31 would be too late — that one would just go into the pool as normal.

Note that if you made several buy-backs on a single day, they would first be merged into one combined purchase — so the rule always matches the sale against a single buy per day.

What happened to the pool?

Nothing. The 500 shares sold were matched to the 500 bought back, so they offset each other. The original 1,000 shares at £0.40 remain in the pool, exactly as before — the investor still owns 1,000 LLOY at the end of all this.

Section 104 pool now holds

1,000
shares
£400.00
total cost
£0.40
average per share

Unchanged. The sell-and-rebuy was a wash for the pool; only a small £20.00 gain on the price difference is taxable.

The result

Proceeds
£250.00
Allowable cost
£230.00
Gain
£20.00

Notice what the rule did to the gain

Using the pool would have shown a £50.00 gain (£250.00 − £200.00). The bed & breakfast rule gives £20.00 instead (£250.00 − £230.00), because the sale is matched at the near-identical buy-back price. This cuts both ways: it can shrink a loss you were hoping to claim, which is exactly the loophole the rule was built to close.

What to remember

  • Sell, then rebuy the same share within 30 days after the sale, and the sale is matched to the rebuy — not the pool. It can apply even across two tax years.
  • The window looks forward from the sale; a repurchase before the sale doesn't count (it might be same-day instead).
  • If you rebuy fewer shares than you sold, only that many are bed & breakfast; the rest fall back to the pool.
  • This is the last rule applied before the pool. Anything not matched same-day or within 30 days finally comes out of the Section 104 pool.

Related: same-day rule, Section 104 pool, the all-three-rules walkthrough, or getting started with CGT.

Sources

The rules and figures in this guide come from HMRC and GOV.UK. This site is independent and not affiliated with HMRC.