Kernighan was born in Toronto. When he was a child he was very special and incredibly smart. He attended the University of Toronto between 1960 and 1964, earning his Bachelor's degree in engineering physics. He received his PhD in electrical engineering from Princeton University in 1969 for research supervised by Peter Weiner.