This post explains taxes for cryptocurrencies via 3 examples, and introduces the difference between FIFO & LIFO. These are artificial examples, and not advice.

The examples in this post have round numbers, that are easier to read, but might feel more fake. If you prefer examples with real numbers, check out this version of the same post.

Understanding the basics of taxes is important not just for paying taxes, but also to inform your trading strategy and to avoid unpleasant surprises. I hope this post gives you some new insights into how taxation works, and the next time you’ll buy or sell crypto something will click in your head, and you’ll be thinking about taxes, too. At the end of the post, I’m sure one of your thoughts will be “and so, how do I calculate my real taxes?” For that you probably need a tool, and I can recommend CoinTracking (note: affiliate link with 10% discount), or ZenLedger.

So let’s get pen & paper, a calculator, and let’s get started!

### Buy, sell, gain… and pay taxes.

This is a made-up example, just to warm up. Make sure you understand it well, because we’re going to build upon it, and we’ll reuse these same numbers later.

Say you bought 1BTC on Feb 1st 2017, when the price was $1,000.On Aug 15th, the price of BTC was $4,000, and you decided to sell 0.6BTC. You then had 0.4BTC remaining, and you still have them today.First, the good news: you don’t have to pay any taxes on your 0.4BTC.Now let’s look at the 0.6BTC that you sold. You’ve got $4,000 x 0.6 = $2,400. Originally you paid $1,000 * 0.6 = $600. So you gained $2,400 — $600 = $1,800.This $1,800 is your capital gain, and you have to pay taxes on it. Based on your tax bracket, this may be anything up to 35% of $1,800. Let’s use 30% for the sake of this example, so you’d have to pay $1,800 * 30% = $540.In summary, if you bought 1BTC at $1,000, and sold 0.6BTC at $4,000, on your account you have 0.4BTC and $2,400. Because your gain is $1,902.41, you have to pay roughly $540 in taxes. In light of this example, here is a first learning.

In light of this example, here is a first learning.

Learning #1. If you sell any crypto for USD, you may want to withdraw part of your earnings, to make sure you can cover your taxes.

In the example, on your account you have 0.4BTC and $2,400, and you may want to withdraw at least the $540 that will cover your taxes.

### Trade crypto for crypto.

Next example, what if we never sell to USD, but only trade crypto for crypto, such as exchanges BTC for ETH? You can guess the answer: we still have to pay taxes, and here’s how to compute them. Let’s completely forget about the previous example, fresh new account, though a similar story.

Say you bought 1BTC on Feb 1st 2017, when the price was $1,000.On Aug 15th, when the price of BTC was $4,000, you decided to buy ETH from your BTC.The price of ETH was $400, or 0.1BTC, so with your 1BTC you bought (rounded) 1 / 0.1 = 10ETH. You never bought or sold anything else throughout the year.In your account you have 0BTC, $0, and 10ETH.The fact that you sold your BTC, whether for real money or for another crypto still counts as capital gain, and you have to pay taxes on this gain.Let’s calculate the gain. On Aug 15th, you sold 1BTC worth $4,000, so your gain is $4,000 — $1,000 = $3,000.Again, if we use 30% for your tax bracket, you’d have to pay $3,000 * 30% = $900.

Note that in your account you have 10ETH, but $0. True, 10ETH today are worth much more than the taxes you have to pay, but still you have to pay these taxes out of your pocket. This is possibly one of the most confusing aspects about taxes, and leads us to the second learning.

Learning #2. If you trade crypto for crypto, at the time of trading you may be realizing a gain, and you have to pay taxes on this gain. Make sure you either have the money, or you account for this when deciding if your transaction is worth.

In the example, at the time of trading BTC for ETH, the price of BTC has increased realizing a gain of $3,000, so we have to pay $900 in taxes, out of pocket.

As an exercise, what if you only sold 0.6BTC for ETH? How much is your capital gain? (Answer at the end.)

### Buy, buy again, then sell — FIFO vs LIFO

Last example: what about real life, where we buy, then buy some more, then sell, and trade, and buy, and… ok, let’s keep it “simple” and see what if we buy, then buy once again, and then sell a part of what we have. Back to a fresh account.

Say you bought 1BTC on Feb 1st 2017, when the price was $1,000.Then you bought another 1BTC on Jun 1st at $2,000.On Aug 15th, the price of BTC was $4,000, and you decided to sell 0.6BTC, getting $4,000 x 0.6 = $2,400. Your account now has 1.4BTC and $2,400. You had a gain, and so there are taxes to pay.

But wait, which BTCs have you actually sold? The ones from Feb 1st, the ones from Jun 1st, half-and-half, or what? Actually, first I have a question for you: which ones would you like to sell, of course to pay less taxes?

To calculate how much taxes you have to pay, you have to decide the strategy that you want to use. Two examples are FIFO and LIFO.

FIFO (**First In**, First Out) means that you assume you sold **the first BTC** you ever bought, so the one from Feb 1st. This case is identical to our very first example. On Feb 1st, for the 0.6BTC that you’re selling, you paid $1,000 * 0.6 = $600. So you gained $2,400 — $600 = $1,800, and, assuming 30% tax bracket, you’d have to pay $1,800 * 30% = $540.LIFO (**Last In**, First Out) means that you assume you sold **the last BTC** you ever bought, so the one from June 1st. Your 0.6BTC on June 1st costed $2,000 * 0.6 = $1,200, and so your gain is $2,400 — $1,200 = $1,200, and taxes would be something around $1,200 * 30% = $360.

Compare the gain with FIFO, $1,800, vs the gain with LIFO, $1,200. And the related taxes… it’s $180 difference! (Back to the question, did you get it right? In this case, to pay less taxes, you’d like to choose LIFO and sell your last BTC.) As an additional exercise, you can calculate FIFO vs LIFO capital gain in case you sold 1.5BTC.

Is LIFO always better than FIFO? Of course not, and of course it gets way trickier if you have many transactions, and of course it gets even trickier if you consider other strategies. But to make sure we end this example with a learning, we can certainly approximate the complexity with the following one.

Learning #3. If you always bought crypto at increasing prices, and you sold part of your crypto, LIFO might be a better strategy than FIFO to calculate your gains, and thus pay your taxes.

In the example, FIFO means paying $540 in taxes, while LIFO means paying $360, a saving of $180. Consult with your accountant to see if this is also better in your case.

This concludes our examples. Throughout the post I left some exercises open, and these are the answers:

- In the example 2, if you trade 0.6BTC for ETH (instead of 1BTC), then all the computation is exactly like in example 1, and your capital gain is $1,800.
- In the example 3, if you sell 1.5BTC, with FIFO the capital gain is $4,000, and with LIFO it’s $3,500… you didn’t dismiss the exercise thinking “they’re equal”, did you? :)

For my own taxes, I’ve been happy with CoinTracking (again note: affiliate link with 10% discount), which is free for a reasonable amount of trades. You can load all your transactions history (tip: load ALL your history, not just the 2017 transactions), and compute gains and taxes with different strategies. I also look forward to trying out ZenLedger.

I think my most important learning was this one.

Learning #4. Crypto looks like money, but it’s not money until you withdraw it. And yet taxes are real money that you have to pay. Make sure you have this money, you’re okay paying out of pocket, or that you withdraw from your earnings in time.

If you have any comments, have found errors in the numbers or terminology, want to recommend your preferred tool for taxes, feel free to use the comments below. Please don’t ask me about your specific case because I’m not an accountant, nor about your issues with CoinTracking because I’m not their support.

Most importantly, if you learned something new from this blog post, please tweet what you learned @0x0ece.

Crypto Taxes for Dummies was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.