The ban will start on July 1, and is part of the government's package to making the banking sector more competitive.
"It removes one of the biggest roadblocks preventing families from getting a better banking deal," Mr Swan said in a statement.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
"Lenders will have to win the loyalty of their customers with good service and competitive lending rates, not by shackling their customers with mortgage exit fees."
He said it was disappointing the coalition couldn't support consumers, and instead tried to keep exit fees in place and lock families into uncompetitive mortgages.
"Getting rid of exit fees is a critical measure that will help boost competition in the home loan market by giving Australians the freedom to walk down the road and get a better deal without being slugged with a penalty fee," the treasurer said.

