The court said it wanted to test if banning fireworks would make a difference to Delhi's air quality, ranked among the worst in the world.
The ban on the sale and distribution of firecrackers will last until 1 November. Diwali falls on 18 October.
Diwali, the most important Hindu festival in north India, celebrates the victory of good over evil.
The Supreme Court order came in response to several petitions, asking for a restoration of the ban it had first ordered in November 2016, before temporarily lifting it in September.
It had said at the time that a complete ban would be an "extreme step".
India's Central Pollution Control Board told the court they also wanted the ban to be restored.
However those who have already bought fireworks will be able to set them off.
Last year's ban on the "possession, stocking and selling" of fireworks was ordered only after Diwali, when the city's air quality had already reached hazardous levels.
Choking smog had even forced the Delhi government to shut all schools for three days.
There have been several campaigns in the past asking people to use fewer fireworks during the festival, but these have not been very successful.