Businesses are sitting on record amounts of unused credit from U.S. banks, another quirk in the economic recovery that bankers say could help unleash pent-up spending in the coming months.

Bank executives said their business clients have in recent months ramped up requests for credit lines that can be drawn quickly for spending on inventory, labor or expansions.

Companies aren’t actually drawing the money into their bank accounts just yet. Businesses are already stuffed with cash, and supply-chain issues and labor shortages have crimped their ability to spend it. But bankers say the activity in recent months is evidence that businesses are planning to turn on the spending spigot. That could help the economy shoot higher.

JPMorgan Chase & Co. and Bank of America Corp. , the two biggest banks in the U.S., together had nearly $1 trillion in unused corporate credit at the end of June. That is up 20% from a year ago and a quarterly record at both banks.

“This virtuous circle of hiring workers and meeting customer spending will help drive the economy, and hopefully will result in more line usage on our loans,” Bank of America Chief Executive Brian Moynihan told analysts last month.

For large banks with a bigger concentration on commercial lending, there has been an average 21% increase in unused commercial and industrial credit compared with the prior year, according to a review of available filings by Janney Montgomery Scott analysts.

The Federal Reserve’s survey of senior loan officers in July reported banks were getting more inquiries from commercial and industrial borrowers about both new and increased credit lines. The banks also said they had loosened their restrictions on the maximum size of the lines.

Bank executives said the demand is coming from companies in healthcare, industrial products, food products and wholesale supply. They said companies appear to be arming up in hopes they can build back inventory quickly if their supply chains can deliver the products they need.

For instance, auto dealers starved of inventory are sitting on large unused credit lines, executives at several banks said.

Bankers view the untapped credit as a sign that their corporate clients are optimistic about the economy’s trajectory.

In a June survey of commercial-banking clients, JPMorgan found business confidence at its highest level in the survey’s 11-year history. About 46% of the businesses surveyed said they expect to increase capital spending and 38% said they would need to increase their credit, a sharp rise over the past two years.

“I’ve never seen anything quite like it,” said Jim Glassman, the head economist at JPMorgan’s commercial bank. He said businesses are planning ambitious spending projects, especially on automation and technology.

For banks, the unused credit isn’t particularly helpful because they can’t charge interest on the money until it is drawn. With bond markets surging, cash aplenty and interest rates near zero, banks have struggled to increase loans and lending profits. That has become a focal point for investors wondering if bank stocks can keep rising.

The credit lines are something of a green shoot that would typically lead to higher borrowing in the coming months, executives said.

“The good news inside all that is we’re actually winning a lot of clients and we’re extending facilities at a pace beyond where we’ve been for a bunch of years,” PNC Financial Services Group Inc.’s CEO William Demchak said on a conference call with analysts. “The problem is they’re just not drawing.”

It is still unclear how much of the unused credit will turn into spending. In March 2020, when much of America shut down to slow the spread of Covid-19, businesses raced to draw their credit lines in an effort to stockpile cash. They have continued to add cash in the months since.

When the coronavirus tore through industry, commerce and society in March 2020, the U.S. economy came to a screeching halt. Top executives relive the tough decisions they made as they scrambled to weather the storm. Photo Illustration: Adele Morgan/The Wall Street Journal The Wall Street Journal Interactive Edition

The lingering memory of the shutdowns may spur businesses to keep their powder dry for some time to come, especially during a surge of new infections from the highly contagious Delta variant.

“It may be an evolution,” said Christopher Marinac, a bank analyst at Janney Montgomery Scott. “Some of this may be building a better toolbox because what we learned from Covid is we have to be prepared.”

Write to David Benoit at david.benoit@wsj.com