The S&P 500 (SNPINDEX:^GSPC) posted a dramatic leap in 2013, with more than 90% of its component stocks having gained ground during the year. But because the S&P 500 is weighted by market capitalization, the companies that saw their market caps rise the most had the greatest impact in pushing the S&P higher. Let's look at which five stocks led the way higher for the index.

Stocks

Tech reigns supreme
In looking back at the past year, tech stocks made the biggest contribution to the S&P 500's rise, with Google (NASDAQ:GOOGL), Microsoft (NASDAQ:MSFT), and Amazon.com (NASDAQ:AMZN) topping the list. Perhaps the most surprising thing about two of these three winners is that Google and Microsoft both arguably qualified as value stocks coming into 2013.

Google's market cap soared more than $135 billion in 2013, with investors finally giving the online-search giant credit for years of solid growth in revenue and net income. Strategic moves to acquire handset builder Motorola Mobility have paid off with continued heavy adoption of Android-powered devices, and Google's efforts to monetize its online search dominance more effectively in the mobile realm has finally started bearing fruit. Even now, after gains of more than 55% in 2013, Google's stock still carries a relatively inexpensive forward earnings multiple of just over 20, making it look relatively attractive compared to its growth prospects.

Microsoft's market-cap gains of $82 billion during 2013 might well come as an even larger surprise, given that the tech giant still seems like it's in a state of turmoil. With CEO Steve Ballmer on his way out, Microsoft has a big power vacuum at the top that it hasn't moved swiftly to fill. Moreover, the company's forays into tablets as well as continuing challenges in getting customers to adopt its Windows 8 operating system have led to widespread uncertainty among those who follow the stock. Nevertheless, Microsoft's major purchase of Nokia's mobile-device division helped give it more control over Windows Phone-driven handsets, hopefully guaranteeing Microsoft the No. 3 position in the U.S. market now that BlackBerry has fallen out of favor. With a forward multiple of less than 13, investors still haven't given Microsoft full credit for any growth potential.

One tech stock that has no value-investing aspirations is Amazon, which posted a more than $70 billion rise in its market cap. That's all the more impressive because Amazon was by far the smallest of the three tech giants coming into the year, with a market cap of just half Microsoft's and Google's. Yet investors continue to look at the massive revenue gains that Amazon has produced, both on the main e-commerce side of its business and in its Amazon Web Services cloud division. Investors seem more comfortable than ever with Amazon's failure to produce short-term profits, believing that the company is smarter to grab up market share first before flipping the profit switch in the future. Given the relatively small penetration of online retail and the increasing popularity of cloud computing, Amazon has plenty of growth potential in the future -- even if its stock might already incorporate much of it.

Going beyond technology
Beyond tech titans, other stocks also gave a lift to the S&P 500. Warren Buffett's Berkshire Hathaway (NYSE:BRK-B) clocked in at No. 4, with a $66.3 billion jump according to S&P Capital IQ's figures. The conglomerate benefited in many ways in 2013, with its core stock holdings climbing along with the market, while its wholly owned subsidiaries also provided strong financial performance for the company. With interest rates as low as they are, Berkshire's equity-based float-investing model gives it a competitive advantage over more conservatively invested insurance companies, and solid increases in book value keep supporting the stock.

Johnson & Johnson rounded out the top five with a rise of just under $65.6 billion. The company's pharmaceutical division played a big role in J&J's growth in 2013, defying many of its pharma competitors and their more substantial patent-cliff-related revenue declines. Because of its status as a health-care conglomerate, incorporating consumer goods and medical devices as well as drug production, J&J has been able to give shareholders greater diversification while still taking advantage of a strong pipeline with potential for substantial future growth.

One thing to remember about all of these big gainers is that at some point, it becomes difficult for huge megacap stocks to produce the kind of growth rates that we saw this year. For now, though, these stocks have overcome the large-stock handicap and provided nice gains for shareholders, and there's reason to believe they could continue to perform well in 2014 and beyond.

Fool contributor Dan Caplinger owns shares of Berkshire Hathaway. You can follow him on Twitter: @DanCaplinger. The Motley Fool recommends Amazon.com, Berkshire Hathaway, Google, and Johnson & Johnson and owns shares of Amazon.com, Berkshire Hathaway, Google, Johnson & Johnson, and Microsoft. Try any of our Foolish newsletter services free for 30 days. We Fools don't all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.