Named after the legend who robbed from the rich to give to the poor, Robinhood offers commission-free stock and option trades at a time when even the least-expensive brokers charge $5 per trade. That pitch has helped Robinhood open more than 4 million accounts since 2013, making it bigger than E*Trade, which went online in 1991!

But where Robinhood can save users real money on commissions, the service trades user experience for tax inefficiency. Its users could easily end up saving a little on commissions and paying a lot more in taxes.

Why capital gains taxes matter

Investors are handsomely rewarded by the U.S. tax code, which favors wealth earned by long-term investing to income derived from work. In every tax bracket, capital gains are taxed at a rate less than or equal to tax rates on ordinary income.

Capital gains tax is a unique tax because it's 100% voluntary. A gain isn't taxable until it is realized. Thus, investors who never sell -- and many try to do just that -- can defer gains indefinitely.

Here's how it all works: When you buy shares of stock, a cost basis is ascribed to the lot. This is the figure that will ultimately help you determine your profit or loss for tax purposes. So, if you bought Shopify shares in 2014 for $25 each, you would have a capital gain of $120 per share if you sold them at a recent price of $145.

Of course, people often add to their portfolios little by little, purchasing shares at different points in time and at different prices. It's not unrealistic for an investor to have some Shopify shares they acquired for $25, and some they acquired for $105. And that means that the investor would incur a different tax bill when they sell, depending on which lot of stock is sold.

Being tax smart

Most investors carefully choose which tax lots they sell so as to minimize their tax bill. If you have two lots of stock, you'd generally receive the most after-tax cash by selling the stock with the smallest amount of gains.

The table below illustrates how your cost basis can affect how much you pay in taxes, and why it pays to be tax smart when selling a portion of your investments. It compares the tax consequences of selling Shopify stock acquired at $25 and $105 per share, based on a capital gains tax rate of 15%.

Metric Shopify stock purchased in 2014 Shopify stock purchased in 2016 Current value (A) $145 $145 Cost basis (B) $25 $105 Tax rate (C) 15% 15% Capital gain (A-B) $120 $40 Taxes ((A-B)*C) $18 $6 After-tax proceeds

(A-((A-B)*C)) $127 $139

In this example, the investor would be better off selling the Shopify stock purchased at a higher price in 2016, since it would trigger a smaller tax burden ($6 per share vs. $18 per share). He or she would have to sell fewer shares to generate the same amount of post-tax cash to reinvest or spend.

It may seem like a trivial matter, but this is really important. If this investor wanted to sell some Shopify stock to buy five shares of Amazon, they would have to sell 63 shares of Shopify purchased in 2014, or 58 shares of Shopify purchased in 2016, to do it. Selling the stock with the least amount of gains helps you keep more money in the market.

Most brokers make it easy to choose which tax lots you want to sell when you place a sell order, but Robinhood doesn't allow you to choose. It uses a "first in, first out" method for tax purposes, also known as FIFO. When you sell stock with Robinhood, the stock you bought first is sold first -- period.

Since stock prices generally increase over time, the earliest lots are most likely to have the largest amounts of gains, which could force investors to realize more gains and pay more in taxes when placing trades. So, while the forced FIFO method helps users avoid complicated tax decisions, it also means that its users may incur unnecessarily high taxes when they sell a portion of their holdings.

Getting what you pay for

To be clear, I have no personal vendetta against Robinhood. It lowered the bar for participating in the stock market, and it offers its services for free, which is, for many people, better than paying $5 for every trade.

But freebies have their disadvantages, some of which aren't as obvious as they may seem. Forcing users to use FIFO when selling stock makes it more difficult to harvest losses to save on taxes and eliminates opportunities to minimize taxes on winning investments. To my knowledge, it's the only online broker that doesn't allow its users to choose which tax lots they sell when placing a trade.

Robinhood can be an excellent choice for people who want to rapidly churn a small portfolio, since the commissions saved will likely paper over any incremental tax costs. But investors who take the long view and make larger investments may end up saving pennies in commissions and paying dearly in capital gains taxes.