Stocks have been flying higher lately as excitement over new generative artificial intelligence (AI) technologies and prospects for interest rate cuts from the Federal Reserve combined to help push the S&P 500 up 16% since Oct. 27.

At this point, a market crash seems unlikely, but you can never rule one out. There's always the potential for a black swan event like a new war or a pandemic that can tank the market, and it's never a bad idea to be prepared for a pullback with a list of stocks you'd want to buy if share prices dive. Two that look to me like no-brainer buys if their prices fall again are JPMorgan Chase (JPM 0.06%) and Microsoft (MSFT 1.82%). Let's take a closer look.

A man sitting at a desk doing research

Image source: Getty Images.

1. JPMorgan Chase: Fortress Dimon is as strong as ever

It's easy to forget, but JPMorgan Chase is one of the biggest companies on the stock market, with a market cap of nearly $500 billion. Only a handful of non-tech companies are worth more.

JPMorgan Chase is the nation's largest bank by assets, and its stock trades near its 52-week high amid the broader market's recovery. That makes sense: Banks are highly cyclical, and investors seem to be betting that the economy will avoid a recession and continue to strengthen.

However, that cyclicality is one reason why JPMorgan Chase would be a smart buy in a market crash. If the market sells off, the big bank is likely to take a dive too, but it has proven time and again that it is built to last. JPMorgan Chase was the healthiest major bank during the financial crisis, and it still maintains a rock-solid balance sheet thanks to CEO Jamie Dimon's "fortress" principles.

Its third-quarter results were strong with a return on tangible common equity of 22% and a Common Equity Tier 1 (CET1) ratio of 14.3%, showing that the bank is well prepared to handle an economic shock.

Additionally, JPMorgan Chase shares look cheap, trading at a price-to-earnings ratio of 10, meaning the stock would get even cheaper in a market crash, at least based on its current earnings. Investors would have to be patient with a recovery as the bank's results are likely to trend in sync with the economy, but there's little doubt that JPMorgan would eventually bounce back from a downturn. A market crash could also provide it with an opportunity to acquire another bank, much as it did when it bought First Republic earlier this year.

2. Microsoft: A diversified tech giant

Microsoft has been riding high this year, powered by its partnership with OpenAI and the emergence of new products like Copilot and Azure OpenAI. Meanwhile, it has rebounded from the slowdown in the tech sector, reporting accelerating overall growth and strong results in its cloud-computing segment.

Among the big tech stocks now known as the "Magnificent Seven," Microsoft is the most diversified, with businesses including a range of enterprise software products, its Azure cloud-infrastructure business, the Windows operating system, a video game segment that features the Xbox and now Activision Blizzard, news and advertising products like Linkedin, and the GitHub code repository.

That should give Microsoft a degree of resilience that its peers can't match in the event of a downturn or market crash. Additionally, it's only one of two companies with a credit rating of AAA from Standard & Poor's. (The other is Johnson & Johnson.)

Since Microsoft is heavily dependent on business spending, the stock would be likely to follow the broader market lower in a sell-off, but it's a safe bet that its business would bounce back in a recovery. Its products are incredibly sticky as millions of businesses depend on them daily, and it has made smart strategic moves in areas like cloud computing and AI under CEO Satya Nadella.

Microsoft would be an easy stock to buy in a market crash.