Tech stocks have been on the rise since Jan. 1, beginning to recover from the steep declines they suffered in 2022. Investors have rallied around Apple (AAPL -0.75%) and Advanced Micro Devices (AMD -1.07%), with both companies' shares up more than 10% in the new year.

Apple has a variety of new products launching this year, including one that will see it venture into a high-growth market. Meanwhile, AMD's booming data center business recently got a huge leg up on Intel, one of its biggest competitors.

Apple and AMD would likely be an asset to any portfolio, offering substantial and consistent long-term growth, with both companies' stocks enjoying triple-digit gains over the last five years. But if you're only looking to add shares of one of these tech specialists right now, you'll need to know which is the better buy in 2023. Let's find out. 

Apple seeks new strength through independence

After a year plagued with macroeconomic headwinds, the theme of Apple's 2023 seems to be striving for independence, starting with its iPhone. This priority on moving away from relying on other companies to manufacture a product that made up 52% of its revenue in 2022 is positive for Apple's long-term stability and growth. 

On Jan. 9, Bloomberg reported Apple will begin using homegrown telecom and Wi-Fi/Bluetooth chips by 2025, ending partnerships with current sources Qualcomm and Broadcom. Then on Jan. 11., Bloomberg revealed the Mac maker would be swapping out iPhone screens from Samsung and LG for in-house designed versions. 

Both moves will reduce operating costs, allowing Apple to earn more per phone, which adds extra protection to its business in the case of further economic challenges weakening demand. 

In addition to component independence, Apple is taking steps to differentiate the iPhone's operating system from Alphabet's Google apps by improving offerings concerning maps, search, and advertising. Apple's attitude going forward seems to be if there's money to be made from its most in-demand product, it will be the company to make it.

Apple shares have risen 242% since 2018. With potentially boosted profits in its iPhone business over the long term and high demand for its other popular products and services, the company is absolutely worth an investment in 2023.

AMD shows potential with data center innovation

AMD shares plummeted 55% in 2022 as declines in the PC market sent investors running for the hills. The company has gradually begun to recover in 2023, with its stock up 12% since Jan. 1.

Despite a challenging year, AMD has much to offer over the long term, as evidenced by its 463% gains since 2018. It's not out of the woods in regards to the sluggish PC market. However, its booming data center business makes the semiconductor company an attractive potential investment. 

In the third quarter of 2022, AMD's data center segment made up the greatest portion of revenue, rising 45% year over year to $1.6 billion. And the business is looking more lucrative with the launch of AMD's new generation of data center chips. The Genoa chips, which were released in November, already have cloud platforms such as Microsoft's Azure, Oracle, and Alphabet's Google signed on as clients.

However, more impressive is AMD's leg up on Intel's data center chips, which were unveiled on Jan. 10. The Intel chips, called Sapphire Rapids, had gone through four delays, which led them to be released two years later than expected. In addition to being tardy, Bernstein analyst Stacy Rasgon claims that recent benchmarks show AMD's Genoa outperforms Sapphire Rapids on "general purpose workloads."

With a more powerful chip -- the Genoa-X -- due to launch later this year, AMD could be well positioned in the quickly growing data center market.

Which is the better buy?

Apple and AMD both have excellent long-term outlooks, with solid positions in some of the world's most lucrative markets. In order to determine which might be the better buy today, we can look at a few valuation metrics that help indicate whether a company's stock price aligns with its financial performance. Comparing price-to-earnings ratios, Apple's P/E ratio of 23.4 makes its stock a better bargain than AMD's P/E ratio of 43.4. Using this metric alongside the price-to-free cash flow metric, which helps gauge how much cash a company has on hand relative to its stock price, we can see that the iPhone company has clearly overcome an economically challenging year in better form (Apple's P/FCF ratio is 21; whereas, AMD's is 31.3).

Ultimately, Apple is currently in a more stable, reliable position. This makes it the better tech stock in 2023. However, AMD is still a company to keep a close eye on and potentially invest in at the next opportunity.