For many investors, 2022 was nothing short of catastrophic. Fueled by high inflation and rising interest rates, the S&P 500 delivered its worst performance since the financial crisis in 2008 (down 19.5% for the year), and the Bloomberg Aggregate U.S. Bond Index fell more than 13%, marking its worst performance since its inception in 1976.

Some individual stocks fared even worse than the broader market in 2022. Alphabet (GOOG -0.86%) (GOOGL -0.83%), for instance, saw its stock price fall almost 39% for the year while HubSpot (HUBS 0.31%) stock was down 56% in 2022. On a positive note, many Wall Street analysts have a bullish outlook on Alphabet and HubSpot as we enter 2023. Is it time to buy these growth stocks?

1. Alphabet

According to CNN, 75% of analysts covering Alphabet currently have a buy rating on the stock, and the median 12-month price target implies 40% upside. That may surprise investors because Alphabet recently delivered a disappointing third-quarter report; revenue growth slowed to 6% and earnings fell 24%. But Wall Street's bullish outlook can be attributed to two things: Alphabet dominates the digital ad market, and it is gaining share in cloud computing.

Alphabet is best known for Google, a brand that is synonymous with internet search. In fact, the company holds more than 92% market share among search engines, while its closest competitor holds just 3% market share. YouTube also falls under the Google umbrella, and it recently surpassed Netflix to become the top streaming service in terms of viewing time. Both platforms make Google a valuable advertising partner for brands. Case in point: Google currently captures about 28% of global digital ad spend, according to Insider Intelligence.

Turning to cloud computing, Google Cloud Platform (GCP) still trails Amazon and Microsoft by a wide margin, but the company invested aggressively in its product offering and go-to-market strategy, and those investments are paying off. IT research company Gartner published a report in October 2022 that noted "GCP had both the highest percentage of revenue gains and improvements" across cloud infrastructure and platform capabilities of any vendor. In other words, Google made more progress than Amazon and Microsoft since Gartner issued its previous report 2021.

In a nutshell, Alphabet has a strong presence in two large and growing markets. Global digital ad spend is expected to increase at 9% annually through 2030, while cloud computing spending is expected to increase by 20% annually through 2029. That means Alphabet has a great shot at achieving double-digit revenue growth through the end of the decade, and with shares trading at 4 times sales -- essentially the cheapest valuation in the past five years -- investors should indeed consider buying this growth stock today. That said, Alphabet is best viewed as a long-term investment, meaning there is no guarantee investors will see positive returns in 2023.

2. HubSpot

According to CNN, 83% of analysts covering HubSpot currently have a buy rating on the stock, and the median 12-month price target implies a 31% upside. That bullish outlook reflects the company's strong competitive position in the customer relationship management (CRM) software market.

HubSpot's CRM platform comprises a suite of tools that drive productivity across sales, marketing, customer service, and operations. It also includes a content management system that enables businesses to build engaging web experiences. In a nutshell, HubSpot helps clients attract leads, convert leads into paying customers, and maintain lasting relationships with those customers.

Whereas CRM titan Salesforce relies heavily on acquisitions, HubSpot differentiated itself through organic product development, creating a broad suite of software that integrates seamlessly behind a single user interface. That is a particularly compelling proposition for small businesses that lack robust IT support. Additionally, HubSpot employs a freemium pricing model and tiered product offering that enabled a successful land-and-expand strategy.

In the third quarter, its customer count increased by 24%, and the average subscription revenue per customer rose by 7%. In turn, revenue climbed 33% to $444 million and cash from operations rose 41% to $60 million. Those results are particularly impressive given the challenging economic climate, and investors have good reason to believe the company can maintain its momentum in the long run.

HubSpot is the leader in CRM software among small businesses, and software research company G2 recently ranked HubSpot as the second-best global software seller (in any category) based on its high user satisfaction scores and strong market presence. That puts the company in a good position to capitalize on its growing market opportunity, which will rise from $45 billion in 2022 to $72 billion by 2027.

Currently, shares trade at 8.4 times sales, a bargain compared to the five-year average of 14.8 times sales. That creates a good buying opportunity, but only for investors who commit to a buy-and-hold strategy. HubSpot may or may not produce a positive return over the next year, but it is well-positioned to create value for shareholders over the next five to 10 years.