Earnings season is in full swing, with many of the world's most valuable companies' stocks on the move. Like most of the year, this month Wall Street has been particularly bullish on artificial intelligence (AI) and its potential to bolster a number of industries. Apple (AAPL -0.65%) and Alphabet (GOOG -1.19%) (GOOGL -1.13%) both have growing ventures in the market, making their stocks attractive options over the long term. 

Apple has the dominance in consumer tech that could attract millions to its future AI offerings. Meanwhile, Alphabet has just had a glowing quarter that indicates its business is on a growth path after last year's economic downturn.

However, if you're only looking to add one new company to your portfolio, you'll want to know which is currently the better investment option.

So, let's take a look at whether Apple or Alphabet stock is the better buy this August. 

Apple

Apple has built up a reputation among investors for being one of the most reliable stocks on the market. The company's shares have risen 247% in the last five years, significantly higher than fellow tech giants such as Microsoft, Alphabet, and Amazon. Apple's reliability came alongside nearly unrivaled dominance in the consumer tech industry, with leading market shares in most of its product categories. 

However, Apple's stock has faltered since the start of August, dipping 8% after its earnings release for the fiscal third quarter of 2023, which ended July 1. Macroeconomic headwinds caused reductions in consumer spending across tech, with Apple reporting sales declines in its iPhone, Mac, and iPad segments. 

Despite the challenging quarter, Apple demonstrated its strength by outperforming its competitors. In the second quarter of fiscal 2023 (ended March 31), when iPhone sales fell 6% year over year, Samsung's smartphone sales decreased by 37%, and Motorola's tumbled 17%. Apple's performance allowed it to gain market share in smartphones, increasing from 52% to 55% in the quarter.

Apple's recent stumble is why keeping a long-term perspective on its stock is crucial. The company might not be out of the woods amid poor market conditions. However, growing positions in artificial intelligence, virtual/augmented reality, and digital services will likely provide substantial gains in the next five to 10 years and beyond. 

Alphabet

Alphabet's stock has risen about 5% since the company released its earnings report on July 25. The Google company has had a challenging couple of years with hikes in interest rates causing many businesses to cut down on advertising spending. However, Q2 2023 saw Alphabet report a 3% rise in ad revenue.

Meanwhile, total revenue for the quarter rose 7% year over year and beat analyst expectations by close to $2 billion. Alphabet attributed its positive results to resilience in search and YouTube, as well as cloud growth. 

After years of critics voicing concern for the direction of Alphabet's business, or lack of one, the company has made a major push into AI in 2023. In a recent earnings call, CEO Sundar Pichai said Alphabet has been sharpening its focus, "investing responsibly with great discipline and finding areas where we can operate more cost-effectively."

The company's priority on AI led it to unveil a competitor to OpenAI's ChatGPT in February called Bard. Then in May, Alphabet previewed PaLM2, a large language model that has the potential to bring AI upgrades across the company's software lineup, including search.

Alphabet's hyperfocus on the high-growth industry could provide massive gains over the long term, bolstered by the gradual recovery of the digital ad market. 

Is Apple or Alphabet the better buy?

As two of the world's most valuable companies, it's hard to go wrong with Apple or Alphabet. Both organizations have a history of offering investors reliable long-term growth, primarily thanks to the ever-expanding nature of the tech industry. Alphabet has massively profited from the steady growth of platforms like Google and YouTube, while high demand for Apple's products has helped it dominate the consumer market. 

GOOG PE Ratio (Forward) Chart

Data by YCharts

However, the chart above indicates Alphabet is trading at a better value than Apple. Alphabet's forward price-to-earnings (P/E) ratio and price-to-free-cash-flow (P/CF) ratio are several points below the same metrics for Apple, suggesting your investment could go further with the Google company.

Forward P/E and P/FCF are helpful metrics when determining a stock's value, as one compares a stock's projected earnings with its share price, while the other does the same with free cash flow. 

So if you're having trouble deciding which of these stocks is worth an investment, Alphabet is the better buy this month. However, Apple remains a solid long-term investment and a company worth keeping on your radar.