Malhi received his primary and secondary education at G.H. (Ghulam Haider) Muslim High School, named after his father, who was encouraged by Maulana Muhammad Ali to found this school in 1918, to educate aspiring students.
After his secondary education, Malhi went on to earn a Bachelor of Arts (BA) degree in mathematics and Arabic from Government College Lahore (GCU) and a Bachelor of Laws (LLB) from the University of the Punjab, Lahore.