Online hate crimes should be treated as seriously as abuse committed face-to-face, prosecutors in England and Wales have been told.
Revising its guidance for prosecutors, the Crown Prosecution Service said the impact of tweeting abuse can be as "equally devastating" as shouting it.
The guidance includes offences against bisexual people for the first time.
Director of Public Prosecutions Alison Saunders said online abuse can fuel "dangerous hostility".
A hate crime is an offence motivated by a "hostility or prejudice", including racism, sexism or homophobia.
How to deal with internet trolls
Writing in the Guardian, Ms Saunders said recent events in the US - where white nationalists clashed with counter-protesters in Charlottesville - showed what online abuse can lead to.
"Whether shouted in their face on the street, daubed on their wall or tweeted into their living room, the impact of hateful abuse on a victim can be equally devastating," she said.
She said the internet and social media in particular have provided "new platforms" for abuse.
In December 2014, Scotland's Crown Office issued similar prosecution guidance, saying "if it would be illegal to say it on the street, it is illegal to say it online".
'Not just words'
Love Island contestant Olivia Attwood told the Victoria Derbyshire programme: "There are things I look at and I think 'is this normal? Are you just meant to see this and just pretend you haven't seen it?'"
Labour councillor Seyi Akiwowo received a tirade of racist and gender-based slurs in February 2017. She was called the N-word and "a monkey".
Ms Akiwowo told BBC Radio London: "They're not just words. They actually echo the behaviour we don't tolerate in society so we shouldn't start thinking its OK to say on any platform, on social media and the internet.
"There needs to be a big campaign about proper conduct online...[and] about what you can do as a witness.
"You wouldn't be a bystander to a crime in society. If we saw someone being mugged, or being abused we wouldn't stand back we would try and intervene in some way."
The CPS says it has set out more clearly what victims and witnesses should expect from the law.
The new legal guidance and accompanying CPS public statements guide prosecutors deciding whether to charge suspects of offences motivated by hostility towards people of different races, religions, sexuality, gender and disability.
Cases should be pursued with the same "robust and proactive approach used with offline offending".
It says exceptions to prosecution should be made in the case of children who may not appreciate the potential harm they have caused by publishing something online that amounts to a hate crime.
Until now, CPS guidance on hate crime motivated by sexual orientation has had a general focus on all victims.
The new guidance specifically refers to bisexual victims, particularly if they report being victimised by gay men or lesbians.
Hate crime is any criminal offence "which is perceived by the victim or any other person to be motivated by a hostility or prejudice".
The difficulty is working out where the line is drawn between that and words that are simply offensive.
Obvious examples are words linked to violence - such as the racially-aggravated threat made by an aristocrat on Facebook against businesswoman Gina Miller.
Other online abuse can amount to harassment or the crime of inciting hatred.
Campaigners say too many charging decisions based on existing guidance have landed on the wrong side of the line, leaving victims let down.
If the CPS is serious about getting tough with online hate crime, they say there needs to be more than a change in guidance - there needs to be a change in will.
According to the latest figures, the CPS successfully prosecuted more than 15,000 hate crime incidents in 2015-16 - the highest number ever. A third of those convicted saw their sentence increased because of the hate crime element of the offence - also a record.
However, in the same year, the number of cases being referred by police to prosecutors for a decision fell by almost 10%.
Nik Noone, chief executive of Galop, a charity that campaigns against anti-LGBT violence and hate crime, said its own research suggested many victims did not have confidence in the police to report online hate attacks.
"The threshold for prosecuting online hate crime is very high, and the investigative process is often too slow and cumbersome to respond to the fast-moving online world," she said.