Fukuoka, Japan, has been awarded the championships for a second time following a successful staging in 2001.
Meanwhile, Qatar's capital Doha will host the event for the first time, although it did hold the 2014 World Swimming Championships.
Both cities saw off competition from Nanjing in China, while Hungary's capital Budapest had initially been considered for the 2021 edition before standing in to stage the 2017 championships after Guadalajara withdrew due to financial concerns.
"Today we were presented three extraordinary bids fulfilling all requirements and having great facilities," said FINA president Julio Maglione.
"Both winning cities, Fukuoka and Doha, are strong partners of FINA and will offer optimal conditions for the organisation of these championships.
"There is a very strong commitment from the local authorities to welcome this event in their respective dynamic metropolis."