German Justice Minister Heiko Maas said the measures would ensure German law was applied online.
Social media cannot “become a funfair for the far right,” he said.
The agreement follows reports of a rise in online racism in Germany as the country manages an influx of up to one million migrants and refugees in 2015.
Mr Maas said complaints about hate speech would be assessed by “specialist teams” at the three companies, who would also make it easier for such posts to be reported.