Global governing body World Aquatics said China had won the bidding process for the event which includes swimming, artistic swimming, diving and water polo among other sports.
Shanghai hosted the 2011 world championships.
The 21st edition of the championships are ongoing in Doha, Qatar, until February 18th.
Singapore will host the next event in 2025, with Budapest hosting in 2027.