It's hard to say, because many foreigners left during COVID. Many sources state that either Beijing or Shanghai have the most foreigners, and both are frequently listed as the best cities for foreigners living in China.