It will be the first meeting between the two leaders since Merkel began her fourth term as German chancellor on March 14.
The ministry said PM Modi will make the stopover in Berlin following a suggestion by Merkel.
"At the suggestion of German Chancellor Angela Merkel, Prime Minister Narendra Modi will be making a brief stopover in Berlin on 20 April after completing his visits to Sweden and the United Kingdom. During his visit, PM will meet Chancellor Merkel and the two leaders will exchange views on a number of bilateral, regional and global issues," it said.
It said the visit "demonstrates the commitment by the two countries to maintain the momentum of high level exchanges."
PM Modi will begin a five-day visit to Sweden and the UK from April 16 with an aim to boost bilateral cooperation in key areas, including trade and investment.
In Sweden, PM Modi will attend the India-Nordic Summit. The summit is being co-hosted by India and Sweden.
Prime Ministers of all Nordic countries - Denmark, Finland, Iceland, Norway and Sweden - will attend the summit.
PM Modi will first travel to Sweden on a two-day visit from April 16-17. On the second leg of his visit, he will travel to the UK.