So far this year, shares of Bitcoin (BTC 1.53%) mining stocks have been on an absolute tear. If you thought Bitcoin's 85% gains were impressive, just consider what two of the top Bitcoin mining stocks have been up to. Marathon Digital Holdings (MARA 2.21%) is up 460%, while Riot Platforms (RIOT -1.49%) is up almost 500%.

Those are head-spinning numbers and a good reason some investors are now rushing to buy Bitcoin mining stocks hand over fist. So which is the better buy right now: Riot Platforms or Marathon Digital? Let's dig into the numbers.

Bitcoin production numbers

The starting point for any comparison is the absolute amount of Bitcoin these companies are producing. After all, both Riot Platforms and Marathon Digital are essentially pure plays on the future price of Bitcoin, so it only makes sense that the more Bitcoin they can mine, the more valuable they become. And right now, Marathon Digital is the winner. In June, the company mined 979 bitcoins, up a whopping 599% from the year-earlier period. In comparison, Riot Platforms mined 676 bitcoins in May.

But current production is just part of the story as both companies are investing heavily in new production capacity. Marathon, for example, has a new Bitcoin mining partnership in Abu Dhabi that will bring additional production capacity on-stream soon. However, the advantage goes to Riot Platforms, which just inked a blockbuster deal with China's MicroBT at the end of June to purchase additional mining rigs. The deal could potentially triple Riot's mining capacity by the end of 2024.

Engineer using laptop in crypto mining facility.

Image source: Getty Images.

Among Bitcoin miners, one key metric to watch is the hash rate, which is a measure of computational power used to mine new bitcoins. Long story short, the greater the hash rate, the greater the ability to mine Bitcoin.

At the end of June, Marathon had a total operational hash rate of 21.8 EH/s (exa hashes per second) and forecast a goal of 23 EH/s. Compare that to Riot Platforms, which plans to boost its hash rate from its current 10.6 EH/s to 20.1 EH/s by mid-2024. Thus, 12 months from now, Riot and Marathon will essentially be running neck-and-neck in terms of Bitcoin mining capacity.

The cyclical nature of Bitcoin

In making a pick between these two companies, it's essential to keep in mind other factors beyond just how much Bitcoin they can produce. After all, Bitcoin is very cyclical, and both companies are highly leveraged to the price of Bitcoin. So it's important to look at the overall financial health of a Bitcoin miner to determine how well it will do in a downturn.

Riot Platforms has a slight edge here because it is carrying less debt on its balance sheet than Marathon, making it much more nimble when it comes to adapting to difficult conditions. Riot Platforms is also known for being one of the most cost-efficient Bitcoin miners in terms of the total cost of mining a single Bitcoin. This is something I want to see as an investor: the ability to hold down costs, especially during challenging market conditions.

I'm also keeping my eye on ways these companies are diversifying away from being pure-play Bitcoin miners. It's interesting to note that in January 2023, Riot Platforms actually changed its name from Riot Blockchain.

This was before this year's Bitcoin rally started, of course, so the company had no way of knowing what was coming next. The company likely assumed that Bitcoin could fall another 65%, just like it did last year, and was already making plans to find other avenues for growth. Thus, one of its three business segments is actually related to engineering, power distribution, and electrical equipment. This focus on diversification provides an added margin of safety.

And the winner is...

While Riot is currently trailing behind Marathon in terms of absolute levels of Bitcoin production, that will likely change by 2024. Thus, taking a long-term view of the situation, Riot is clearly gearing up to become the market leader. And that's why I'm leaning toward Riot as my top Bitcoin mining stock.

However, just keep in mind that the business cycle for Bitcoin mining stocks is very real. So if you are investing for the long haul, you need to be confident in the long-term uptrend for Bitcoin and be willing to endure the inevitable zigs and zags of the crypto market.