PIT How to
Cost Basis 101: Understanding FIFO for PIT-38

Cost Basis 101: Understanding FIFO for PIT-38

2026-01-24

๐Ÿงพ Introduction

One of the most common questions investors ask during tax season is: "I bought Apple stock three different times at three different prices. Now I sold half of it. Which price do I use for my taxes?"

Many people instinctively try to calculate an average price.
Stop right there. ๐Ÿ›‘

In Poland, for standard stock and ETF investments, the tax law strictly follows the FIFO (First-In, First-Out) principle. Using a simple average can lead to incorrect tax filings and potential issues with the tax office.

This guide explains exactly how FIFO works and how to calculate your costs correctly for PIT-38.


๐Ÿ’ก FIFO vs. Average Price: What's the Difference?

  • Average Price: You sum up all costs and divide by total units. (Common in crypto or some mutual funds, but NOT the standard for stocks/ETFs in Poland).
  • FIFO (First-In, First-Out): The units you bought first are the ones you sell first.

Why does it matter? If your older shares were cheaper (bought years ago), selling them now (under FIFO) means a larger profit and higher tax today. If you used an average price, you might artificially lower your tax bill, which is illegal.


๐Ÿงฎ Real-Life Example: The FIFO Trap

Let's look at an example to see how FIFO changes the math compared to an "Average."

Purchase History:

  1. Jan 2023: Buy 10 units @ $100
  2. Jun 2023: Buy 10 units @ $150
  3. Jan 2024: Buy 10 units @ $200

Total Holdings: 30 units. Total Cost: $1,000 + $1,500 + $2,000 = $4,500.

The Sale

In August 2024, you sell 15 units for $250 each.

โŒ The Wrong Way (Average Price)

  • Average Cost = $4,500 / 30 = $150 per unit.
  • Cost for 15 units = 15 * $150 = $2,250.
  • Profit = $3,750 (Sale) - $2,250 (Cost) = $1,500 Profit.

โœ… The Correct Way (FIFO)

Under FIFO, you sell the oldest units first.

  • You sold 15 units.
  • Layer 1: Take all 10 units from Jan 2023 (@ $100). Cost = $1,000.
  • Layer 2: Take remaining 5 units from Jun 2023 (@ $150). Cost = $750.
  • Total FIFO Cost = $1,000 + $750 = $1,750.

True Taxable Profit: $$ 3,750 \text{ (Sale)} - 1,750 \text{ (FIFO Cost)} = \mathbf{2,000 \text{ Profit}} $$

The Result: FIFO shows a $2,000 profit, while the "Average" method showed only $1,500. Using the average method would mean underpaying tax on $500 of profit!


๐Ÿ’ฑ The Currency Layer: NBP Rates

To make things spicier, you must convert each layer to PLN using its specific historical exchange rate.

Using the FIFO example above:

  1. Layer 1 Cost: 10 units @ $100 = $1,000.
    • Use NBP rate from day before Jan 2023 purchase.
  2. Layer 2 Cost: 5 units @ $150 = $750.
    • Use NBP rate from day before Jun 2023 purchase.

You cannot just sum the USD and apply one "average" exchange rate. You must calculate the PLN cost for each "bucket" of shares separately and then sum the PLN values.


๐Ÿ“„ Summary for PIT-38

When filling out your PIT-38:

  1. Field 22 (Income): Total value of the sale in PLN (Day before sale rate).
  2. Field 23 (Costs): Sum of the PLN costs of the specific shares sold (calculated via FIFO).

โš ๏ธ Tips for Success

  • Spreadsheet is King: Create a spreadsheet tracking every purchase "batch" (Date, Units, Price, NBP Rate). As you sell, "deplete" the oldest batches row by row.
  • Don't Rely on Broker Reports: Many foreign brokers use "Average Cost" in their default reports because it's simpler or standard in their home country. Do not copy these numbers blindly.
  • Commissions: Remember to add the commission for each specific batch to its cost basis.

By mastering FIFO, you ensure your PIT-38 is bulletproof and you won't have any nasty surprises if the tax office asks for your calculations.