France’s tough new law against online hatred aims to wipe out racist and homophobic trolling on social networks and could be replicated across Europe, according to the politician spearheading it as she faces daily racist abuse on Twitter.

Laetitia Avia, a business lawyer who grew up in the low-income Paris banlieue suburbs where discrimination is rife, was hailed as a symbol of French diversity when she entered parliament for Emmanuel Macron’s centrist party in 2017.

But the daily racist abuse and death threats against her on social networks pushed her to draw up a law to stop trolls feeling they have “total impunity” for saying online what would be more easily prosecuted as hate speech in the street.

“We cannot tolerate on the internet what we won’t tolerate in the street,” Avia told the Guardian. “If you’re on a bus and someone gets up and shouts ‘Dirty black!’, everyone would ask the bus driver to remove that person from the bus. This law will mean that blatantly hateful content must be taken down from a social network site within 24 hours.”

The online hatred bill will be debated by the French parliament next week and could be fast-tracked into force in the autumn.

It states that hateful comments reported by users must be removed within 24 hours by platforms such as Twitter, Facebook or YouTube. This includes any hateful attack on someone’s “dignity” on the basis of race, religion, sexual orientation, gender identity or disability. If the social media platforms and tech companies do not comply, they will face huge fines of up to 4% of their global revenue. Penalties could reach tens of millions of euros. There will also be a new judiciary body to focus on online hate.

The bill is part of Macron’s drive to make France a frontrunner in the regulation of big social media platforms. He announced the planned crackdown on online hate at a dinner for Jewish groups last year, amid a rise of antisemitic acts in France, saying that hateful content online must be taken down fast and “all possible techniques” put in place to find the identities of those behind it.

Last month, after meetings with Macron, Facebook’s Mark Zuckerberg agreed to hand over to judges the identification data on its French users suspected of hate speech.

The French law is in part inspired by Germany’s tough and controversial legislation on online hate speech which came into force last year, amid fears that it was too broad and unrealistic, and could lead to censorship. Avia said the French law would be more specific at targeting hateful comments on social media, and would include penalties against any excess of censorship. Critics of the French bill, including some lawyers and digital rights groups, have warned that tech companies should not be solely in charge of deciding what should be removed.

Avia said the new law would make it easier to stop online race hatred, where current prosecution rates are very low.

She said social networks were in danger of becoming “a kind of hell for those who do not correspond to a standard determined by a minority of trolls”.

She added: “Every day on social networks people insult me and contest my right to speak because of the colour of my skin. I constantly report it and every time I denounce it I get so many positive messages that I sincerely believe those spouting hatred are a minority.”

She said she had to bear in mind online threats when organising media appearances. “It’s a paradox – there will always be a few people who accept that black people from the banlieue can succeed only up to a certain point. I’m a spokesperson for [Emmanuel Macron’s political party] La République En Marche, so I do media appearances. But I know that I mustn’t do more than three days in a row, because if I’m on TV more than four days running I get a storm of hate messages and death-threats. It’s as if I’ll be tolerated up to a certain point and they don’t want to see me any more.”

10h03 : je me connecte sur Twitter.

10h04 : je signale.

Routine du dimanche. #PPLCyberHaine pic.twitter.com/SZjRogCkkz — Laetitia Avia (@LaetitiaAvia) June 23, 2019

Asked if France had a worse problem with racism than elsewhere, Avia said: “No, there are racists everywhere and always will be. France has a problem of awareness of racism, and I see that when people criticise this law and ask what’s the urgency in it. I want to give them my Twitter account for a day to open their eyes.”

As a teenager, Avia, who was born in France to parents from Togo, was among the first high school students from the low-income estates outside Paris to study at the French capital’s political institute Sciences Po as part of a special programme to increase intake from the diverse suburbs. At the time, with outstanding academic results, she was put forward as an ambassador for French diversity. When she was elected to parliament in 2017 as a Paris MP, there were over 30 lawmakers from black and ethnic minority backgrounds, compared to just one black MP from mainland France elected 10 years earlier in 2007.

Avia had never envisaged standing for elected office. “I had a family doctor who advised pursuing a technical profession, saying if I went into politics people would constantly talk about the colour of my skin. During all my time as a lawyer no one ever talked about my colour. When I arrived in politics, it happened and it hasn’t stopped.”