Shopping is increasingly online these days, with Internet-focused retailers like Amazon.com Inc. (AMZN - Get Report) sopping up consumers and driving historic department-store chains like Sears Holdings Corp. (SHLDQ) into default.  

The U.S. banking industry plays a huge role in retail, as the safest way to save and spend cash. However, as retailers are going online, big banks say bricks and mortars are still the way to go.

Bank of America Corp. (BAC - Get Report) , the second-biggest U.S. lender in total assets, said Friday it would accelerate a plan to invest in its 4,400-branch network, building at least 350 new locations in the next three years and modernizing an additional 1,500.

The company plans to push into new markets Cleveland and Lexington, Kentucky, while adding branches in Denver, Minneapolis, Indianapolis, Pittsburgh and Salt Lake City, according to a statement.

Executives at the biggest U.S. banks say that, even in an era where customers increasingly use credit and debit cards instead of cash, mobile phones to deposit checks and computers to trade stocks, people with money still like to visit -- or at least be able to see -- physical locations. The branches have helped Bank of America and JPMorgan Chase & Co. (JPM - Get Report) , the biggest U.S. bank, attract customers and deposits, even though they're paying interest rates of less than 0.1% on regular savings accounts.    

The strategy cuts directly against that of a growing number of online-only banks, including the Wall Street firm Goldman Sachs Group Inc. (GS - Get Report) , that offer top-of-the-market deposit rates to lure customers away from branches. A regular savings account at Goldman Sachs's digital bank currently pays a rate of 2.25%, at its online bank Marcus, with no minimum deposit.

In recent years, customers have become more comfortable with banking online, and startups like LendingClub  (LC - Get Report) have pushed into the business of making loans without physical locations, which can be costly to maintain and staff.   

"Although more clients are using our digital banking capabilities, many still visit our centers for in-person conversations about some of their more complex financial needs," Dean Athanasia, Bank of America's president of consumer and small-business banking, said in the statement.

JPMorgan CEO Jamie Dimon wrote Thursday in an annual letter to shareholders that his company plans to open about 400 new branches in the next few years.

That's the case even though customers can open a new deposit account digitally in three to five minutes, according to Dimon. As of Dec. 31, the New York-based lender had 5,036 branches.

"Chase's retail-branch expansion amplifies our opportunity to deepen relationships with clients," the CEO wrote.

Bank of America says it has opened 150 new branches over the last three years and modernized 1,000. 

The presence of a bank branch can serve as a powerful advertising and marketing tool, and many people still want financial advice face-to-face, says James Tierney, chief investment officer for concentrated U.S. growth at the $516 billion money manager AllianceBernstein Holding LP (AB - Get Report) .

"It's the cost of doing business," Tierney said in a telephone interview. "You just have to be there."

David Hendler, a financial-industry analyst at Viola Risk Advisors, says many bank executives still feel they need "some bricks-and-mortar branches to solidify and enhance your smartphone banking, because that's where the big profit margins are, due to the low-cost delivery."

But branches do run the risk of becoming obsolete and empty, which could eventually lead to huge losses, he says.

Dick Bove, an analyst at the brokerage firm Odeon Capital, says Bank of America likely has done extensive market research to evaluate whether the expansion plan will pay off. A rule of thumb is that banks typically need about three years to recoup the cost of building a new branch, he says.

"I don't care if Goldman sets up all the Marcuses in the world," Bove said. "None of these competitors have the ability to go face-to-face. Bank of America has defined a market need, they have the solution to that need, and they're facilitating that need."

JPMorgan, Amazon and Goldman Sachs are holdings in Jim Cramer's Action Alerts PLUS member club. Want to be alerted before Jim Cramer buys or sells JPM, AMZN or GS? Learn more now.

How Much Money Will I Need to Retire?

Want to learn about retirement planning from some of the nation's top experts? Join TheStreet's Robert "Mr. Retirement" Powell live in New York on April 6 for our Retirement Strategies Symposium. For a limited time, tickets are available for $99 for this full-day event. Check out the agenda, learn about the speakers and sign up here.