Boris Johnson said Football Banning Orders would be amended to allow this and that tech firms would be fined for failing to stop "vile behaviour".
His comments follow several England players being abused following the Euro 2020 final defeat to Italy.
But Labour leader Sir Keir Starmer said the PM's words rang "hollow".
He accused Mr Johnson of "trying to stoke a culture war" by refusing to condemn football fans who booed players for taking the knee.
Some Conservative MPs and activists have also expressed unease at the government's stance, with former minister Steve Baker saying the outpouring of support for England's Marcus Rashford, Bukayo Saka and Jadon Sancho should serve as a "wake-up" for the party.
A 37-year-old man was earlier arrested by Greater Manchester Police over social media posts.
An online petition calling for the FA and the government to ban those who have carried out racist abuse to be banned from football grounds for life has attracted more than one million signatures.
In a statement, Mr Johnson said: "I was appalled by the abhorrent abuse directed towards a number of our footballers in the aftermath of Sunday's game. More must be done to prevent people being bullied and trolled online."
New laws would "force social media companies to take responsibility and action where this vile behaviour exists" or face fines, he added.
Mr Johnson also said: "We are also working closely with the football and police authorities to ensure we can track and take action against online abusers and will ban them from football grounds in the same way we would if they had committed these offences on our streets."
At Prime Minister's Questions, Mr Johnson said the England team "represent the very best of our country", adding: "I utterly condemn and abhor the racist outpourings that we saw on Sunday night."
A football banning order is used to prevent someone from attending matches for between three and 10 years.
It can be imposed for offences such as throwing missiles on to the playing area or into the crowd, and racist or indecent chanting at a match.
Labour leader Sir Keir Starmer - who has been calling for online racists to be banned from matches - said the government had only promised to act because "they've realised they're on the wrong side, and now they're hoping nobody has noticed".
He accused the PM of "trying to stoke a culture war" by refusing "time and time again - even now - to condemn those who boo our players for standing up against racism".
But the prime minister said: "Nobody defends booing the England side."
Ahead of the Euro 2020 tournament, Mr Johnson declined to condemn England fans who booed players taking the knee, saying fans should "cheer them on, not boo".
Home Secretary Priti Patel described the act as "gesture politics". Asked in June if she would criticise fans who booed England players taking the knee, she said: "That's a choice for them, quite frankly."
On Monday, she tweeted that she was "disgusted" by the online abuse directed at England players.
England footballer Tyrone Mings replied that she had "stoked the fire" through her stance on taking the knee.
Sir Keir challenged the prime minister on the home secretary's stance, saying: "He (Mings) is right, isn't he?"
Mr Johnson defended the home secretary and said Ms Patel had "faced racism and prejudice all her career of a kind that he can never imagine".