Mars bars are taking a step towards being carbon neutral after the company that makes them signed a 20-year deal in Australia to generate 100 per cent of its electricity from renewable energy by 2020.

Mars, which also makes Pedigree dog food and M&Ms, said its Australian subsidiary will sign a deal with energy company Total Eren to build a solar plant in Victoria by mid-2019.

The confectionery maker also plans to facilitate the build of a second renewable project by Total Eren in New South Wales. Contracts agreed under the deal will provide electricity to

Mars will not take energy directly from the solar farm. Instead, it underwrites the expansion of the solar project, receiving energy certificates of equivalent value in return. These effectively offset the carbon emitted by electricity used at Mars' six Australian factories and two sales offices, the company said.

Australia is currently is one of the worst greenhouse gas polluters per capita in the world, with electricity generation being a major contributor. The global food industry is estimated to be responsible for around a third of greenhouse gas emissions.

Barry O’Sullivan of Mars Australia said the company was motivated to make “a long-term commitment to a sustainable, greener planet that will benefit our customers, our consumers and the local and global community".

He also said rising electricity prices last year accelerated the company’s plans to move to renewable which it has already done in the US, the UK and nine other countries.

"We acted quickly because the price volatility of energy in Australia made renewables the best option for our business, in addition to getting us closer to our commitment to eliminate greenhouse gases from our operations by 2040," Mr O’Sullivan said.