Ministers say say it's part of their plans to cut down on pollution.
Speaking on BBC Radio 4's Today programme, Environment Secretary Michael Gove said: "We can't carry on with diesel and petrol cars, not just because of the health problems that they cause, but also because the emissions that they cause would mean that we would accelerate climate change, do damage to our planet and to the next generation."
He also pledged to work with local authorities developing "value for money and appropriately targeted" diesel scrappage schemes.
Speaking on Premier's News Hour, Andy Lester from A Rocha UK said: "The reality is this is important, if we are going to take pollution seriously we are going to have to look at alternatives to traditional combustion.
"Electric or even hydrogen-powered cars are the future, the sooner we move towards that the better, but it is going to take time to take place, it's not going to be an overnight change."
Some have suggested the government could have gone further while others have suggested the 2040 date may be unrealistic.
Andy Lester thinks it will be a seamless transition.
He said: "Over the next 10 years we will see all the leading manufacturers vying for position on alternative energy vehicles," he said. "As that becomes more competitive, so the prices will drop for the consumer."
Listen to Andy Lester speaking to Tola Mbakwe on Premier's News Hour: