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.
25 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
AuthorYou'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
Miguel Hernández
As someone who works in tax preparation, I see this confusion all the time during tax season! You're definitely not alone in feeling overwhelmed by the FIFO/LIFO/SpecID decision - most of my clients who've transitioned to active trading have the same questions. One thing I always tell people is to think about your overall tax situation, not just the individual trades. If you're in a higher tax bracket this year but expect to be in a lower one next year (maybe due to retirement, job change, etc.), you might want to defer gains by using specific identification to sell your highest cost basis shares first. Conversely, if you expect to be in a higher bracket next year, it might make sense to realize some gains now. Also, don't forget about the Net Investment Income Tax (3.8% additional tax on investment income for higher earners). If you're close to those thresholds, strategic lot selection can help manage not just your regular capital gains tax but also whether you trigger NIIT. The good news is that once you get the hang of this, it becomes second nature. And the tax savings really do add up over time - I've seen clients save thousands just by being more intentional about their cost basis elections. Keep asking these questions and learning!
0 coins
Hannah Flores
This is incredibly helpful perspective from a tax professional! I hadn't even considered how my expected future tax bracket should influence my lot selection strategy. That's a whole other layer of complexity I need to think about. The point about the Net Investment Income Tax is especially eye-opening - I'm nowhere near those thresholds now, but if my trading continues to be successful, it's something I should probably start planning for. It sounds like there's a lot more strategic planning involved than just "pick the lots with the best cost basis." Your comment about it becoming second nature is reassuring. Right now it feels like there are so many variables to consider (cost basis, holding period, current vs future tax brackets, NIIT thresholds) that I'm worried I'll make the wrong choice. But I suppose like any skill, it gets easier with practice. Do you have any recommendations for resources where I can learn more about the broader tax strategy aspects? Most of what I've found focuses on the mechanics of FIFO vs LIFO but doesn't get into the bigger picture planning you're describing.
0 coins
Luca Romano
For broader tax strategy resources, I'd recommend starting with IRS Publication 550 (Investment Income and Expenses) - it's dry but comprehensive. The Bogleheads wiki also has excellent sections on tax-efficient investing that go beyond just the mechanics. For more advanced planning, consider Kitces.com - Michael Kitces writes detailed articles about tax strategy that bridge the gap between basic concepts and professional-level planning. His pieces on tax-loss harvesting and asset location are particularly good. One practical tip: start tracking your marginal tax rate each year and any major life changes that might affect it (job changes, marriage, kids, etc.). This will help you make better real-time decisions about when to realize gains vs losses. You're right that it seems complex at first, but most people only need to master a few key concepts to capture 80% of the available tax savings. Also, don't underestimate the value of a one-time consultation with a fee-only financial advisor or CPA who specializes in investment taxation. Even just an hour or two of personalized advice based on your specific situation can save you years of trial and error.
0 coins
AstroAdventurer
This has been such an educational thread! I'm relatively new to active trading myself and had no idea there were so many strategic considerations around cost basis methods. One thing I'm wondering about that hasn't been covered much - how does this all work with dividend reinvestment plans (DRIPs)? I have several positions where I've been automatically reinvesting dividends for a couple years, which means I have tons of tiny lots at different prices. Does this make specific identification super complicated, or do most brokers handle this reasonably well in their interfaces? Also, for those using tax optimization tools like taxr.ai that were mentioned earlier - do they account for DRIP purchases when calculating the best lots to sell? I'm imagining that with dozens of small dividend reinvestment lots, the optimization becomes pretty complex. Appreciate everyone sharing their experiences here. This is exactly the kind of practical knowledge I wish someone had told me about when I first started investing more actively!
0 coins
Andrew Pinnock
Great question about DRIPs! This is something I've been dealing with too. Most brokers actually handle DRIP lots pretty well in their interfaces - they'll show each dividend reinvestment as a separate lot with its own purchase date and price. At Fidelity, when you go to sell, you'll see all those tiny lots listed out, which can look overwhelming at first but gives you good flexibility. The complexity really depends on how long you've been reinvesting dividends. If you've got years of monthly or quarterly reinvestments, you might have 20+ lots for a single position. But the upside is that this gives you tons of options for tax optimization - you can cherry-pick lots based on both cost basis and holding period. As for tax optimization tools, I haven't used taxr.ai specifically, but most good tax software should account for DRIP purchases since they're just regular lot purchases from a tax perspective. The tools I've seen usually let you upload your full transaction history, which would include all the dividend reinvestments. One tip: if you're planning to do active lot selection with DRIP positions, consider whether you want to continue the automatic reinvestment or switch to taking dividends in cash. The constant creation of new tiny lots can make the decision-making more complex, though it also gives you more optimization opportunities.
0 coins