The Online Hate Crime Hub is made up of five specially trained Met police officers who will try to identify, prevent and investigate online abuse.
Sadiq Khan said officers would "work with community experts to develop the police's understanding of online hate".
It is the first hub of its kind in the UK and will cost Â£1.7m over two years.
It is being funded by the Met and the Mayor's Office for Policing And Crime (MOPAC), with Â£452,000 also being contributed by the Home Office Police Innovation Fund.
Any online hate crimes reported to police in the capital, including abuse posted on Twitter and Facebook, will be looked into by the unit.
Officers will provide referrals to victim support groups and work with police in relevant boroughs to investigate.
City Hall said discussions were also under way with social media companies "to develop appropriate online sanctions for perpetrators of online hate".
Victoria Wright, a disability and disfigurement rights campaigner in London, who has been subjected to online abuse, called the hub "a much needed initiative that will make a real difference".
"It's vital that those of us who are victims of online hate crime receive a robust response from the police," she said.

The serious flooding affected large parts of county Londonderry as well as nearby Donegal.
On Wednesday morning, the flood water was still several feet high outside the Drumahoe venue after the nearby River Faughan burst its banks.
Friday's Championship game against Ballyclare switches to Dixon Park.
The expectation is that Institute will be unable to play home games at their premises for at least a month.
The club's dressing rooms are also understood to have been damaged by Tuesday's flooding which caused major disruption throughout the North West.
Pictures of the damage were put on Institute's Twitter feed on Wednesday and the club described the situation as "soul destroying".

A judge dismissed the charge against the retired sportsman after identifying inconsistencies in Tina Wallace's evidence.
She also refused a prosecution application to impose a restraining order.
Mr Wallace, 37, was accused of subjecting his wife to harassment over two dates in May last year.
By that stage the couple had split after 11 years of marriage, with the ex-rugby star moving out of the family home in east Belfast.
Belfast Magistrates' Court was told he sent 41-year-old Mrs Wallace a number of text messages on 1 May.
During a contested hearing she claimed he appeared at the kitchen window of the house while a male friend was present.
It was also alleged that her husband tried to take photographs.
Mr Wallace, capped 30 times in an international career which involved being part of Ireland's 2009 Grand Slam-winning team, denied the allegations.
His barrister challenged the account during cross-examination of the alleged victim.
Delivering judgment on the case, the judge stressed that successful prosecution on a harassment charge required a course of conduct of at least two incidents.
She pointed to discrepancies between the evidence given of the second alleged incident and an account given in separate proceedings.
The judge said it was unfortunate police did not obtain a statement from the witness in the house.
"I cannot be satisfied to the relevant standard what happened on that date," she said.
"In those circumstances I have to dismiss the charge."
Mr Wallace, of Station Road in Holywood, County Down, left court without commenting on the case.
But his lawyer, said: "Mr Wallace is pleased with the outcome of today's hearing and wishes to thank his legal team, friends and family for their support at this difficult time.
"He now wants to move on with his life and focus on his two children."
A police unit to help tackle online hate crime and provide better support for victims in London has been launched by the capital's mayor.
[NEXT_CONCEPT]
Institute's Riverside Stadium is likely to be unavailable for some time after their pitch was badly damaged by flooding on Tuesday night.
[NEXT_CONCEPT]
The former Ireland and Ulster rugby star Paddy Wallace has been acquitted of harassing his estranged wife.