The high court decision paves the way for what would become the largest class action in South African history.
The ex-miners say they contracted silicosis, an incurable lung disease, from years of working in the mines.
The court said that a class action was “the only realistic option”.
Judge Phineas Mojapelo’s decision could lead to a court case lasting up to 10 years, the BBC’s Nomsa Maseko reports from Johannesburg.
But the former miners are still hopeful that the case could help improve their lives as well as those of their families, our reporter says.
Silicosis, caused by inhaling the silica dust in gold-bearing rocks, can lead to breathing difficulties, regular coughing and chest pains, and it can also lead to tuberculosis.
Analysis: Pumza Fihlani, BBC Africa, Johannesburg
The lawyers representing the miners believe this court ruling marks the first step towards justice.
Most of the miners who allegedly contracted silicosis while working underground have been unable to work for many years, dependent on government grants for a living.
The claims, going back decades, also involve former miners from neighbouring countries such as Lesotho.
A number of gold companies have been named in the suit including Anglo American, one of two companies which reached a $30m (£21m) suit with 400 miners in a separate silicosis case.
It is not clear if this class action will be settled out of court, but for the miners who say they have waited for too long, a speedy resolution would be a form of justice.