8 August 2017 Last updated at 11:11 BST
This was called the Partition of India.
As a result, many families were split up and forced to leave behind their homes for good. Around 12 million people became refugees.
Many families have been unable to go back to the homes that their relatives had to leave behind.
Now, 10-year-old Sumayyah, 11-year-old Shubhashukla and nine-year-old Kamolpriya are on the mission of their lives to find out what happened to their families.
What will they learn? Will they track down their relatives' old houses?
Find out by watching Finding My Family - Partition: A Newsround Special.
In 1947, British India became independent and split up into two new countries: Pakistan and India.