Microsoft (NASDAQ:MSFT) and Salesforce.com (NYSE:CRM) are two of the most successful technology companies of all time. They dominate massive global markets. They're growing at incredible rates for businesses their size, and they've created fortunes for their longtime shareholders.

But which of these stocks would be the best to add to your portfolio today? To find out, let's analyze Microsoft and Salesforce in four key areas: competitive position, financial strength, growth, and valuation.

A person pointing to a stock market graph on a digital display

Image source: Getty Images.

Competitive position

Salesforce is the global leader in customer relationship management software, with a market share greater than that of its three closest competitors combined. And it continues to widen its lead over its rivals. 

Salesforce is also expanding into massive new markets. Its acquisition of MuleSoft made it a leader in the rapidly growing field of data integration, at a time when businesses are increasingly seeking to collect and analyze data from more sources than ever before.

Like Salesforce, Microsoft dominates several of its core markets. Office continues to command the lion's share of the business productivity market. Windows remains the most popular desktop operating software on personal computers worldwide, though Apple, Alphabet, and others have gained share in recent years. Microsoft also has a rapidly growing cloud computing platform in Azure, though in this important area, it's a clear No. 2 to Amazon.

All told, both Salesforce and Microsoft possess powerful competitive advantages. But I'd argue that Microsoft faces more significant competition from formidable rivals in several of its most important businesses. Therefore, Salesforce has the edge here.

Advantage: Salesforce.com

Financial strength

Let's now review some key financial metrics to see how these tech giants stack up.

Metric

Microsoft

Salesforce.com

Revenue

$118.5 billion 

$13.3 billion 

Operating cash flow

$46.1 billion

$3.4 billion

Free cash flow

$31.9 billion

$2.8 billion

Cash

$127.7 billion 

$4.3 billion 

Debt

$73.2 billion 

$3.2 billion 

Data sources: Morningstar, company filings.

Microsoft's revenue and cash flow production dwarf those of Salesforce. It also has $54.5 billion in net cash on its balance sheet, compared to $1.1 billion for the SaaS player. Clearly, Microsoft has a substantial edge in terms of financial strength.

Advantage: Microsoft

Growth

Microsoft may be more financially powerful, but Salesforce is expanding at more rapidly. Wall Street expects Microsoft's earnings to rise by 14.5% annually  over the next five years, driven primarily by its Office 365 and Azure cloud services. Salesforce, meanwhile, is projected to grow its profits by 28.5% annually  during that period, fueled by its sales, service, and marketing cloud businesses -- as well as its game-changing MuleSoft acquisition. Thus, Salesforce has a clear edge in term of expected earnings growth in the coming years.

Advantage: Salesforce.com

Valuation

Lastly, let's compare the two based on some common stock valuation metrics.

Metric

Microsoft

Salesforce.com

Price-to-sales ratio

7.83 

9.33 

price-to-free-cash-flow ratio

29.09 

36.53 

Forward price-to-earnings ratio

24.24 

46.72 

Price-to-earnings-to-growth ratio

1.87 

2.04 

Data sources: Morningstar, Yahoo! Finance.

By every measure, Salesforce's shares are significantly more expensive than those of Microsoft. This is to be somewhat expected, considering Salesforce's higher projected earnings-growth rate. But even if that is factored in -- as the PEG ratio does -- Microsoft's stock still looks like the better bargain based on its price today.

Advantage: Microsoft

The better buy is...

Ultimately, you'll need to decide which of these factors is most important to you. Value-focused investors will likely appreciate Microsoft's greater financial strength and more attractively priced shares, while growth investors may prefer Salesforce's strong competitive position and superior pace of expansion. Either way, you'll be buying an elite business that's well positioned to deliver handsome gains to investors in the years ahead.