Six U.S. companies are valued at $1 trillion or more, and they all operate in the technology sector:

  1. Apple (AAPL -1.23%): $3.44 trillion
  2. Microsoft (MSFT 0.89%): $3.16 trillion
  3. Nvidia (NVDA 0.01%): $3.14 trillion
  4. Alphabet (GOOGL 0.17%) (GOOG 0.20%): $2.07 trillion
  5. Amazon (AMZN 0.18%): $1.87 trillion
  6. Meta Platforms (META -0.05%): $1.33 trillion

All of these companies are profitable, so they can be valued with the widely used price-to-earnings (P/E) ratio. It's calculated by dividing the share price of a given company by its earnings per share. The Nasdaq-100 index trades at a P/E ratio of 30.9, which is a good reference point:

NVDA PE Ratio Chart

Data by YCharts.

Nvidia is the most expensive trillion-dollar stock today on a P/E basis. However, the company is growing so quickly it has a forward P/E ratio of just 33.1 based on next year's earnings forecast. In other words, its valuation is much more reasonable if investors are willing to hold it for a couple of years.

The cheapest stock of the group is Alphabet. A judge recently ruled that Google Search is a monopoly, and the U.S. Department of Justice wants to break up the company to resolve that issue. It could take years -- if it happens at all -- but combined with growing competition from artificial intelligence chatbots, which are threatening the dominance of Google Search, investors are treading cautiously with respect to Alphabet's valuation.

Finally, Amazon deserves a mention. It's on track to generate $635 billion in revenue this year, which is more than any of its peers, and it trades at the cheapest price-to-sales ratio (which divides a company's market capitalization by its revenue). Plus, its earnings are forecast to grow 63% this year and 23% in 2025, so its elevated P/E ratio might actually be justified.

In summary, a P/E ratio alone isn't always the best indicator of value. Investors could easily make the case that despite trading at triple the P/E ratio, Nvidia stock is a better buy than Alphabet because of its rapid growth (and Alphabet's regulatory headwinds).