Understanding FIFO / FILO on stocks for tax reporting - which method is better?
So I started investing in stocks about 3 years ago, pretty casually at first - just bought some index funds and a few blue chips and basically ignored them. But since last summer I've been much more active with my portfolio (I blame those investment podcasts lol). I'm buying and selling way more frequently and now I'm realizing I have no clue about the tax implications. I keep hearing about FIFO and FILO methods for calculating gains/losses when you sell partial positions. From what I understand, FIFO means you sell your oldest shares first, and FILO means you sell your newest shares first? But I have no idea which one I should be using or if I even have a choice. For example, I bought 50 shares of XYZ Corp at $75 last year, then another 50 at $120 six months ago. Now the price is $100 and I sold 60 shares last week. How do I figure out my capital gains? Does my broker automatically use a certain method? I use Fidelity if that matters. Also, can I switch between methods for different stocks or am I locked into one approach for my whole portfolio? Any help appreciated, I'm trying to be smarter about this before tax season hits me with surprises.
20 comments


Yara Khalil
Great question about FIFO vs FILO (more commonly called LIFO) for stock sales! This is something many active investors overlook until tax time. For tax purposes, FIFO (First In, First Out) means exactly what you thought - when you sell shares, the IRS assumes you're selling your oldest shares first. LIFO (Last In, First Out) or FILO as you called it means selling your newest shares first. There's also specific identification where you can choose exactly which shares to sell. In your XYZ example: Using FIFO, you'd be selling all 50 of your oldest shares ($75) plus 10 of your newer shares ($120). So your gain/loss would be: 50 shares × ($100-$75) + 10 shares × ($100-$120) = $1,250 gain - $200 loss = $1,050 total gain. Most brokers default to FIFO unless you specifically direct otherwise, including Fidelity. You generally need to specify which lots you want to sell at the time of the transaction. You can use different methods for different stocks, but you need to specify this at the time of sale, not after the fact.
0 coins
Keisha Brown
•Thanks for the clear explanation. Does this mean if I don't specify anything when selling, the IRS automatically assumes I'm using FIFO? Also, is there any advantage to using LIFO instead? Like would it be better for minimizing taxes in some situations?
0 coins
Yara Khalil
•Yes, if you don't specify anything when selling, both your broker and the IRS will default to FIFO. This is why it's important to plan your sales if tax management is important to you. There can definitely be advantages to using different methods depending on your situation. LIFO can be beneficial if your newer purchases are at higher prices and you want to realize losses to offset other gains. Specific identification gives you the most control - you can strategically select which lots to sell based on your overall tax situation. For example, you might want to realize long-term gains (held >1 year) instead of short-term gains that are taxed at higher rates, or harvest specific losses to offset gains elsewhere.
0 coins
Paolo Esposito
I've been using https://taxr.ai for managing my investment tax stuff and it's been a game changer for exactly this kind of situation. I was super confused about lot selection and cost basis when I started trading more actively last year. I uploaded my Fidelity statements and it showed me the tax implications of different selling strategies before I made trades. Apparently I'd been doing it all wrong and probably overpaid thousands in taxes. The tool actually explains which lots would be best to sell based on your overall tax situation and helps track everything for tax time. It also showed me how to do tax-loss harvesting properly by identifying which specific shares to sell. Seriously made the whole FIFO/LIFO decision much clearer with actual numbers from my portfolio.
0 coins
Amina Toure
•Does taxr.ai connect directly to brokerages like Fidelity? I'm using three different platforms (got carried away lol) and the thought of manually entering everything makes me want to cry.
0 coins
Oliver Weber
•I'm skeptical about these tax tools. Does it actually help with the form filing or just gives advice? I've had bad experiences with other tax software completely missing things when I had investment income.
0 coins
Paolo Esposito
•It doesn't connect directly to brokerages yet, but you can upload your statements or transactions CSV and it imports everything automatically. I was in the same boat with multiple accounts and it handled that just fine - saves so much time compared to manual entry. The tool does both - gives strategic advice about which lots to sell and also helps with the actual tax forms. It generates the full Schedule D and all the necessary forms for reporting investment income. What impressed me most was how it caught several wash sales I had no idea about that my previous tax software completely missed.
0 coins
Amina Toure
Just wanted to update that I tried taxr.ai after seeing the recommendation here. Honestly mind blown at how much easier this makes things! I uploaded my statements from all three brokerages and it immediately identified several places where I could have saved on taxes with better lot selection. I was basically throwing money away by not paying attention to FIFO vs specific identification. The interface is super straightforward and actually EXPLAINS things rather than just giving numbers. I'm not a tax expert by any means, but now I feel like I can make smarter selling decisions. Already saved about $1,200 in taxes by identifying some lots I should sell now for tax-loss harvesting. Wish I'd known about this earlier!
0 coins
FireflyDreams
If you're running into trouble getting answers from your broker about tax lot methods, I highly recommend using https://claimyr.com to get through to a real person at Fidelity. I spent HOURS trying to get clear answers about changing my default cost basis method and kept getting stuck in their automated system. Finally tried Claimyr after a friend suggested it, and they got me connected to a Fidelity investment specialist in about 10 minutes. The specialist walked me through the exact process for selecting specific lots when selling and even helped me retroactively adjust some recent sales where I should have used specific identification instead of FIFO. You can see how it works here: https://youtu.be/_kiP6q8DX5c Turns out Fidelity actually has pretty flexible options but it's buried in their system and the regular customer service people don't always know the details.
0 coins
Natasha Kuznetsova
•Wait you can retroactively change the lot selection method after selling? I thought once the trade was executed that was it. How far back can you go to make these adjustments?
0 coins
Javier Morales
•This sounds like a paid service just to talk to customer service? That's ridiculous, why would anyone pay for something that should be free? I'm sure if you just stay on hold long enough you'll eventually get through.
0 coins
FireflyDreams
•You can typically make adjustments until the settlement date of the trade (T+2 for most securities). So you have a small window, not indefinitely. In some cases with proper documentation, brokers might allow adjustments for a bit longer, but it's entirely at their discretion. I completely understand the skepticism about paying to reach customer service. I felt the same way initially! But after spending literally 4+ hours across multiple days trying to get through and being disconnected repeatedly, the time savings alone was worth it. It's not just about waiting on hold - it's about navigating the maze of automated systems that seem designed to prevent you from reaching a specialized representative who can actually help with cost basis questions.
0 coins
Javier Morales
Well I stand corrected about Claimyr. After my skeptical comment I spent 2.5 hours today trying to reach someone at Fidelity who could explain my cost basis options. Got transferred three times and then disconnected. Finally broke down and tried the service and got through to someone who actually knew what they were talking about in less than 15 minutes. The Fidelity rep explained that I had been using default FIFO for everything but could use their "lot relief method" tool to specify exactly which shares I want to sell. Also learned they have a tax lot optimizer that I never knew existed because it's not prominently displayed in their interface. Definitely saved me a lot of headache for future trades.
0 coins
Emma Anderson
Something nobody mentioned yet - SpecID (specific identification) is actually better than both FIFO and LIFO in most cases. You can cherry-pick exactly which shares to sell to optimize your tax situation. For example, if you have some shares at a loss and some at a gain, you can selectively sell the losers to harvest tax losses. Or if you're trying to qualify for long-term capital gains rates, you can specifically sell shares you've held over a year. Just make sure you specify BEFORE the trade executes. Most brokers make you select the tax lots during the order process now.
0 coins
Malik Thompson
•This is what I've been trying to do but I'm confused about one thing - do you have to specify the exact purchase date for each lot? I have like 20 different purchase dates for some stocks I've been DCAing into for years. Seems super tedious.
0 coins
Emma Anderson
•You don't always need to specify the exact purchase date, though having that info helps. What you really need is the cost basis for each lot and whether it's long or short term. Most broker interfaces will show you a list of all your lots with their purchase dates and costs when you go to sell. It can be tedious if you have lots of small purchases, but the tax savings can be substantial. Some brokers have tools that let you filter lots by criteria (like "sell all lots with losses" or "sell oldest shares first"). Also, once you get in the habit of doing this with each trade, it becomes pretty quick. The tax optimization is definitely worth the extra minute or two per trade.
0 coins
Isabella Ferreira
Just wanna point out - FILO isn't actually the right term. It's LIFO (Last In, First Out). FILO would be First In, Last Out which is just another way of saying LIFO. But everyone in accounting and tax uses LIFO. Also be aware that wash sale rules can mess up your clever tax planning if you're not careful. If you sell at a loss and buy substantially identical securities within 30 days before or after, you can't claim the loss.
0 coins
LunarEclipse
•You're right, I got the terminology mixed up! I've been reading so many different articles and they must have been using different terms. LIFO makes more sense anyway (Last In, First Out). That wash sale rule is definitely something I need to watch out for. I've definitely been guilty of selling something and then buying it back a week later when the price drops more. Didn't realize that could affect my tax situation.
0 coins
CosmicVoyager
•The wash sale rule is the WORST when you're actively trading. I got completely burned last year when I didn't realize my IRA purchase triggered a wash sale on a loss I took in my regular account. Such a headache.
0 coins
Ella Russell
This is such a timely discussion! I've been struggling with the same issues since I started more active trading this year. One thing I learned the hard way is that you really need to think about your overall tax strategy, not just individual trades. I initially just used whatever my broker defaulted to (FIFO), but after talking to my CPA, I realized I was missing opportunities. Now I try to look at my entire portfolio at year-end and see if there are strategic moves I can make. Sometimes it makes sense to realize some losses to offset gains, or vice versa. Also want to echo what others said about keeping good records. Even with all these fancy tools and broker statements, I started keeping my own spreadsheet tracking purchase dates, amounts, and my reasoning for each sale method I chose. Makes tax prep so much easier and helps me learn from past decisions. The wash sale rule mentioned above is definitely a trap - I almost fell into it myself when I panic-sold during a market dip and then bought back in too quickly.
0 coins