A Blackberry cell phone is seen at Fixx wireless on November 4, 2013 in Miami, Florida.National Journal

The Senate unanimously approved legislation late Tuesday to legalize cell-phone unlocking, which would make it easier for consumers to switch providers without buying a new phone.

The House passed a similar bill earlier this year, but the House version included language to ban people from unlocking phones in large batches. The two chambers will now need to agree on a single version before it heads to the president's desk.

In a statement, Senate Judiciary Committee Chairman Patrick Leahy urged the House to quickly pass the Senate bill "so that consumers will be able to use their existing cell phones on the wireless carrier of their choice."

Most contract cell phones come "locked" to one network. Because of a decision by the U.S. Copyright Office in 2012, customers must obtain their carrier's permission to legally unlock their phones to switch to a competitor—even after they have completed their contract.

The decision prompted an immediate public backlash, and more than 114,000 people signed a White House petition in protest.

The Unlocking Consumer Choice and Wireless Competition Act would overturn the office's decision and would direct the office to consider whether to allow unlocking of other devices, such as tablets.

Consumer groups such as Public Knowledge and the Electronic Frontier Foundation support the Senate bill, although they have also pushed for broader legislation that would amend the underlying copyright law.

CTIA, the lobbying group for cell-phone carriers such as Verizon and AT&T, has backed the bills in both chambers. The group argues the issue is overblown but that the legislation would at least "relieve consumer confusion."

Under pressure from the Federal Communications Commission, all the major carriers already signed on to a commitment last year to allow their customers to unlock their phones.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.