When it comes to the stock market, 2022 might be remembered as the worst year since the 2008 global financial crisis. The benchmark S&P 500 index declined by 19.4%, and the tech-heavy Nasdaq-100 index lost 33%, both ending the year in bear territory.

The selling was broad-based so it was difficult to find individual stocks that could outperform, but investors who ventured onto roads less traveled may have stumbled upon a couple of gems like Interactive Brokers (IBKR -1.50%) and Axcelis Technologies (ACLS 3.16%).

Interactive Brokers stock was down just 7.5% in 2022, soundly outperforming the Nasdaq-100. Axcelis Technologies was in the green by 3.3%, so it was a whopping 36 percentage points better off than the index. Here's how these two companies pulled it off, and how they could do it again in 2023. 

1. Interactive Brokers thrives on stock market volatility

Stock market declines tend to breed fear among investors, which can result in frantic selling combined with more active buying from those hunting for bargains. Overall, higher trading volume is the outcome and that's good news for a company like Interactive Brokers, which earns commissions on those transactions. 

Plus, when the stock market enters bear territory, it tends to attract a wave of media attention, which can draw in new investors. In November, Interactive had 2.07 million total client accounts, and that was up 26% compared to the same time last year. Keep in mind, 2021 was a blockbuster year for the stock market with swathes of first-time retail investors getting involved because of the meme-stock frenzy. That suggests the recent result is far stronger than it seems. 

The downside is that when stocks decline in value, so does Interactive's total client equity, which is simply the value of all financial assets held by customers in their accounts. This figure was $317 billion in November, down 15% year over year. But when the markets rebound, client assets could bounce like a coiled spring given how many new customers the company acquired.

Interactive's full-year results for 2022 haven't been announced just yet, but it had an incredible third quarter (ended Sept. 30). Its Q3 revenue jumped 70% year over year to $790 million, thanks in particular to a higher net interest margin. When interest rates rise, Interactive earns more money on client cash sitting dormant in accounts, plus it earns more from margin loans it gives to customers to buy financial assets.

It's little wonder that Interactive Brokers stock outperformed the Nasdaq-100 last year. But it might do it again this year, given the bear market followed investors into 2023 and interest rates continue to climb. 

2. Axcelis Technologies is bucking the semiconductor industry slowdown

The semiconductor industry is growing in both value and importance. It's responsible for producing the advanced computer chips that power our everyday electronics, from smartphones to cars. While the industry slowed down in 2022 amid weaker economic conditions, that's unlikely to last, and estimates suggest the market for chips could be worth $1.5 trillion per year by 2030. 

Enter Axcelis Technologies, a small semiconductor-service company that makes ion implantation equipment, which is critical to the fabrication process, and sells it to chip producers across the globe. Put simply, if a semiconductor manufacturer is trying to expand its capacity, or even build a new class of chip, Axcelis' equipment is a necessity.

The company bucked the slowdown in 2022. When it officially reports its full-year results in February, management expects it will have generated $885 million in revenue, which beats its initial forecast of $850 million. Plus, its order backlog climbed all year, reaching an all-time high of $1.1 billion in the third quarter (ended Sept. 30). Keep in mind, this company is valued at just $2.6 billion!

In the first nine months of 2022 (which have officially been reported so far), Axcelis' earnings per share came in at $3.75, which was a seismic increase of 105% compared to the same period last year. Analysts expect its final 2022 EPS to come in at $4.80, and based on that, its stock trades at a price-to-earnings multiple of just 16.6 -- that's 30% cheaper than the Nasdaq-100's P/E of 23.8, despite the company's stellar results. 

Axcelis pulled off that record year during a very tough time for the semiconductor industry, and its stock finished in the green, crushing the Nasdaq-100 in the process. So how might the company perform if things improve in 2023? The best might still be ahead, so taking a position is definitely worth consideration for investors.