Mahalanobis belonged to a family of Bengali landed gentry who lived in Bikrampur (now in Bangladesh). His grandfather Gurucharan (1833–1916) moved to Calcutta in 1854 and built up a business, starting a chemist shop in 1860. Gurucharan was influenced by Debendranath Tagore (1817–1905), father of the Nobel Prize–winning poet, Rabindranath Tagore. Gurucharan was actively involved in social movements such as the Brahmo Samaj, acting as its Treasurer and President. His house on 210 Cornwallis Street was the center of the Brahmo Samaj. Gurucharan married a widow, an action against social traditions.
Gurucharan's elder son, Subodhchandra (1867–1953), became a distinguished educator after studying physiology at Edinburgh University. He was elected as a Fellow of the Royal Society of Edinburgh. He was the Head of the Dept. of Physiology, University of Cardiff (the first Indian to occupy this post in a British university). In 1900, Subodhchandra returned to India, founding the Dept. of Physiology in the Presidency College, Calcutta. Subodhchandra also became a member of the Senate of the Calcutta University.
Gurucharan's younger son, Prabodh Chandra (1869-1942), was the father of P. C. Mahalanobis. Born in the house at 210 Cornwallis Street, Mahalanobis grew up in a socially active family surrounded by intellectuals and reformers.
Mahalanobis received his early schooling at the Brahmo Boys School in Calcutta, graduating in 1908. He joined the Presidency College, Calcutta where he was taught by teachers who included Jagadish Chandra Bose, and Prafulla Chandra Ray. Others attending were Meghnad Saha, a year junior, and Subhas Chandra Bose, two years his junior at college. Mahalanobis received a Bachelor of Science degree with honours in physics in 1912. He left for England in 1913 to join the University of London.
After missing a train, he stayed with a friend at King's College, Cambridge. He was impressed by King's College Chapel and his host's friend M. A. Candeth suggested that he could try joining there, which he did. He did well in his studies at King's, but also took an interest in cross-country walking and punting on the river. He interacted with the mathematical genius Srinivasa Ramanujan during the latter's time at Cambridge. After his Tripos in physics, Mahalanobis worked with C. T. R. Wilson at the Cavendish Laboratory. He took a short break and went to India, where he was introduced to the Principal of Presidency College and was invited to take classes in physics.