As many as 32 ISPs, covering over 90% of broadband customers, have already agreed to honour the letter and the spirit of to give consumers a clearer understanding of the speeds they can get and to ensure that they are on an appropriate broadband package.
Ofcom said that it is concerned that consumers could be misled or misinformed when choosing their broadband services by ISPs advertising headline speeds that are higher than users can receive in practice.
The media watchdog's own research has shown that consumer satisfaction of ISPs has fallen over the past year.
To gain a clearer picture, Ofcom is also undertaking a comprehensive broadband survey to identify actual broadband performance across the country and its relationship to advertised headline speeds.
Steps that fixed-line ISPs are required to take under the voluntary code include providing customers at the point of sale with an accurate estimate of the maximum speed the line can support and resolving technical issues to improve speed.
Ofcom will monitor compliance, including through mystery shopping exercises, and if it finds that this voluntary approach is not effective it will consider introducing formal regulations.
Ed Richards, Ofcom's chief executive, said: "Broadband is a thriving market in the UK. We want to encourage real clarity for consumers about the actual broadband speeds they can receive."
Anna Bradley, Ofcom consumer panel chair, said: "The introduction of a voluntary code of practice that gives consumers better information about broadband speeds is a welcome move, and that should enable consumers to make more informed choices.
"It addresses the concerns that we raised with Ofcom last year about the mismatch between the speeds that people think they are buying and what they actually get."
It follows that highlighted the wildly different speeds consumers could receive in different parts of the UK.