The Federal Government wants a mandatory code of conduct for deals between tech giants and news media companies.

Treasurer Josh Frydenberg says new measures will help “level the playing field” by requiring digital platforms such as Google and Facebook to pay news media businesses for their content.

“It's only fair that those that generate content get paid for it,” Mr Frydenberg said.

It comes after the Australian Competition and Consumer Commission (ACCC) was tasked with developing a voluntary code to address the bargaining power imbalance between digital giants and traditional media outlets.

The competition regulator found that achieving voluntary compliance would be “unlikely”.

So, it has now been tasked with creating a mandatory code covering issues including the sharing of data, ranking of news content online and the sharing of revenue generated from news.

It will be enforced through penalties and sanctions.

“Australia needs a strong and sustainable news media ecosystem and the Government recognises the importance of public interest journalism,” Communications Minister Paul Fletcher said.

“Digital platforms need to do more to improve the transparency of their operations for news media providers as they have a significant impact on the capacity of news media organisations to build and maintain an audience and derive resources from the media content they produce.”

A draft code should be ready by July.