The Shinto kami who is the patron of learning and scholarship is Tenjin.
Tenjin is the deified form of Sugawara no Michizane, a distinguished Heian-period scholar, poet, and government official. Michizane lived from 845 to 903 and was exiled to Kyushu after political rivals helped remove him from power. He died in exile at Dazaifu.
After his death, disasters in the capital—including lightning strikes, fires, and heavy rain—were interpreted as signs of his angry spirit. To appease him, the court restored his titles and established worship under the name Tenjin, meaning “heavenly deity.” Kitano Tenmangū in Kyoto became one of his most important shrines.
Over later centuries, Tenjin’s identity shifted from an avenging spirit associated with calamity to a protector of education. Students commonly visit Tenmangū shrines to pray for success in entrance examinations. Ume blossoms and bulls are strongly associated with Tenjin worship. Amaterasu is the sun kami, Hachiman is associated with war and protection, and Inari with rice, prosperity, and commerce.