Nvidia Corp. shares tumbled 18% after the chip maker projected declining revenue for the current quarter—a sharp turnabout from the company’s recent explosive growth—as it works through excess inventory left over from the cryptocurrency boom.

The company reported Thursday that third-quarter profit surged 47% and revenue rose 21%, short of Wall Street’s expectations. Nvidia’s outlook for the fourth quarter fell short, too. Investors pummeled the stock, sending it to $165 after hours from its close at $202.39.

Nvidia...