Berkshire Hathaway (BRK.A 0.68%) (BRK.B 0.93%), the large conglomerate run by legendary investor Warren Buffett, has been a great stock to own since Buffett took over in 1965, transforming it from a struggling textile manufacturer into one of the largest companies in the world.

Between 1965 and 2022, Berkshire's stock generated compounded annual gains of 19.8%, while the broader benchmark S&P 500 generated compounded annual gains of 9.9% including dividends.

But to get a snapshot of how the stock has performed more recently, let's look at Berkshire's performance since the pandemic started in 2020. If you had invested $3,000 in Berkshire's stock at the very start of 2020, here's how much you would have today.

Warren Buffett.

Image source: Motley Fool.

An interesting few years

When the pandemic struck the economy at the beginning of 2020, it changed life as everyone knew it and thus changed the trajectory of many stocks and economic trends. As such, investors changed the composition of their portfolios, seeing big opportunities in names they had probably never considered, while also realizing that stocks they may have been bullish on were no longer as promising.

While we didn't see Berkshire get too crazy and invest in pandemic darlings like Zoom or Peloton, Buffett and his investing team at Berkshire were quick to adapt. The company sold all of its airline stocks, with Buffett citing the coronavirus as the main reason. Berkshire also exited many of its bank holdings. Buffett said he didn't think the banks were being poorly run or in bad shape, but that Berkshire wanted to reduce its exposure to the sector.

Many investors also expected Berkshire to take advantage of the huge sell-off in the market in 2020, pouncing on stocks and making acquisitions similar to what it did during the Great Recession -- especially given the massive hoard of cash the company had built up. But the company took a much more measured approach, remaining patient. 

In the middle of 2020, Berkshire started to deploy a little bit of capital, purchasing Dominion Energy and its associated debt for about $10 billion. In 2021 the company stayed pretty quiet (for Berkshire, anyway), only purchasing about $8.4 billion of stocks that year. However, Berkshire leadership did seem to think their own company was undervalued and bought back more than $27 billion of its own stock that year.

In early 2022, Berkshire began to get more active. The company announced the acquisition of the insurance company Alleghany Corporation for $11.6 billion, which was its largest deal since 2016. Berkshire also deployed more than $57 billion into stocks over the first six months of the year.

Notably, Berkshire went big into U.S. energy following Russia's invasion of Ukraine. The company now owns more than 21% of all outstanding shares of Occidental Petroleum and 8.7% of outstanding shares in Chevron.

If you had invested $3,000 in Berkshire in 2020

Berkshire's stock rose 2.4% in 2020; 29.6% in 2021; and 4% in 2022. Meanwhile, the S&P 500 including dividends rose 18.4% in 2020 and then 28.7% in 2021, before falling more than 18% last year.

Year BRK.A S&P 500
2020 2.4% 18.4%
2021 29.6% 28.7%
2022 4.0% -18%

Berkshire class A shares opened in 2020 at roughly $341,150. As of market close on Feb. 27, shares traded around $461,912, which amounts to a gain of roughly 35.4% in a little more than a three-year period. That means $3,000 invested at the very beginning of 2020 would be worth about $4,062 right now.

The S&P 500 opened 2020 at about 3,244 and closed on Feb. 27 at about 3,982, which equates to a gain of about 23%. So once again, investing in Berkshire would have been the better pick.