Skip to content

CGT Share Matching Rules: Which Shares Did You Sell?

Irish tax guides · Capital gains, gifts and inheritances · 27 November 2026 · 6 min read

If you bought the same shares on different dates and sell some of them, capital gains tax needs to know which ones you sold, because each batch has a different cost. In Ireland, shares bought within the 4 weeks before the sale are matched first. After that, the oldest shares are treated as sold first (first in, first out). Bonus and rights shares are dated with the original shares, and a share-for-share takeover swap is not a sale. The rate is 31% for disposals on or after 7 October 2026, after the €1,270 annual exemption.

Why does matching matter?

With shares in a listed company you do not pick which certificates to hand over. They are all the same class. The law therefore sets a fixed order for deciding which shares you are treated as having sold. That order decides the cost you deduct and so the size of your gain. Our guide to the capital gains tax system explains the overall sum; this post covers the identification step.

To estimate the tax on a gain, try our free CGT calculator.

What is the order of matching?

  1. Shares of the same class bought in the 4 weeks before the sale are matched first. Section 581 of the Taxes Consolidation Act 1997 identifies a disposal with shares acquired within the 4 weeks preceding it.
  2. Then first in, first out. Under section 580, shares acquired earlier are treated as sold before shares acquired later. Any quantity not matched by the 4-week rule is taken from your oldest holding first.
  3. Within a batch, apportion the cost. If you sell only part of a batch, take that fraction of the batch's cost.

How do bonus issues and rights issues fit in?

A bonus issue gives you new shares free, in proportion to what you hold. For CGT the new shares are not a fresh purchase. They are added to the batch they relate to, with the same date and the same total cost. The cost is spread over more shares, so each share costs less. A rights issue offers you new shares to buy. They join the original batch in the same way, and the amount you pay is added to the cost of the batch. Our post on rights and bonus issues and the CGT calculation goes further.

Worked example: Declan sells 1,500 shares

Declan holds quoted shares in an Irish plc:

  • 2012: 1,000 shares for €5,000.
  • 2015: 1,000 shares for €8,000.
  • 2018: a bonus issue of 1 new share for every 4 held. Each batch grows to 1,250 shares. The costs stay at €5,000 and €8,000.

In November 2026 he sells 1,500 shares for €24,000. He bought none in the previous 4 weeks, so first in, first out applies.

  1. The 2012 batch goes first: all 1,250 shares, cost €5,000.
  2. The remaining 250 come from the 2015 batch: 8,000 x 250 / 1,250 = €1,600.
  3. Total cost: 5,000 + 1,600 = €6,600.
  4. Gain: 24,000 less 6,600 = €17,400.
  5. Less the annual exemption: 17,400 less 1,270 = €16,130.
  6. CGT at 31%: 16,130 x 31% = €5,000.30.

The sale is in the January to November window, so the tax is due by 15 December 2026. See our post on CGT payment dates.

The same sale with a recent purchase

Now suppose Declan also bought 200 shares for €3,200 ten days before the sale. The 4-week rule matches those 200 first. The other 1,300 shares come from the oldest batch:

  1. 200 recent shares: cost €3,200.
  2. 1,250 shares from 2012: cost €5,000.
  3. 50 shares from 2015: 8,000 x 50 / 1,250 = €320.
  4. Total cost: 3,200 + 5,000 + 320 = €8,520.
  5. Gain: 24,000 less 8,520 = €15,480. Less 1,270 = €14,210. CGT at 31% = €4,405.10.

One recent purchase changed the tax by €595.20. The rule is not a choice. You cannot treat the sale as coming from whichever batch gives the best result.

Can you sell at a loss and buy straight back?

Some investors sell shares at a loss to bank the loss, then buy the same shares straight back. The 4-week rule blocks this. If you buy back shares of the same class within 4 weeks after a disposal that made a loss, section 581 restricts the loss so that it can only be set against a gain on the reacquired shares. If you rebuy only some of them, the loss is allowed in proportion to the quantity not rebought.

For example, Aoife sells 500 shares for €4,000 that cost €6,500, a loss of €2,500. Within three weeks she rebuys 200 shares. The loss allowed against other gains is 2,500 x 300 / 500 = €1,500. The remaining €1,000 waits until she sells the 200 she rebought, and only against a gain on those. A genuine sale, with the money gone for more than 4 weeks, gets the loss in full. See capital losses and CGT for how allowable losses are used.

What happens in a takeover share swap?

If a company is taken over and you receive shares in the buyer in exchange for your shares, that is normally not a disposal. Under section 586, where the buyer ends up controlling the target, or the exchange follows a general offer for it, the swap is treated as a reorganisation. Your new shares take the old cost and the old date. No tax arises until you sell the new shares. If part of what you receive is cash, that part is treated as a disposal.

What about gifts of shares?

A gift of shares is a disposal at market value. Matching works the same way: the gift is identified with the shares under the same order. You pay the tax, not the person who receives them.

What are the common mistakes?

  • Picking the batch with the highest cost to reduce the gain. The order is set by law.
  • Forgetting a purchase in the last 4 weeks.
  • Treating bonus shares as new purchases at nil cost.
  • Forgetting that a rights issue payment adds to the cost.
  • Treating a takeover swap as a sale.
  • Selling at a loss and rebuying within 4 weeks, then claiming the full loss.
  • Keeping poor records: keep contract notes for every purchase, bonus and rights issue.

Key points

  • Shares bought in the 4 weeks before a sale are matched first (section 581).
  • Then the oldest shares are sold first (section 580).
  • Bonus and rights shares take the date of the old shares; rights payments add to cost.
  • A share-for-share takeover swap is not a disposal if the conditions are met.
  • A loss followed by a rebuy within 4 weeks is restricted to gains on the rebought shares.

The Profit to Capital programme works through disposals and the whole CGT computation, including the course Valuation and disposal proceeds, so you can do your own shares computation and file your own return. You can also read how to file a CGT return for the filing steps.

Questions people ask

How does Revenue decide which shares I sold for CGT?
Shares of the same class bought in the 4 weeks before the sale are matched first. Any remaining quantity is taken from your oldest shares first, which is the first in, first out rule. You cannot choose which batch you sold.
Do bonus shares have their own cost for capital gains tax?
No. Bonus shares are added to the batch they relate to, with the same date and the same total cost. The original cost is simply spread across more shares, so the cost per share falls.
Can I sell shares at a loss and buy them back straight away?
You can, but the loss is restricted. If you buy back shares of the same class within 4 weeks of the sale, the loss can only be used against a gain on the shares you bought back, or in part if you rebought only some.
Do I pay CGT when my shares are swapped in a takeover?
Usually not. A share-for-share exchange in a takeover is not a disposal, and the new shares carry the old cost and date. Tax arises when you later sell the new shares. Any cash you receive as part of the deal is a disposal.

Know someone this would help? Share it.