William Dunbar (born 1459 or 1460) was a Scottish makar active in the late fifteenth century and the early sixteenth century. He was closely associated with the court of King James IV of Scotland and produced a large body of work in Scots distinguished by its great variation in themes and literary styles. He was probably a native of East Lothian, as assumed from a satirical reference in the The Flyting of Dumbar and Kennedie where it is also hinted that he was a member of the noble house of Dunbar. His surname is often written as Dumbar.
Dunbar first appears in the historical record in 1474 as a new student or determinant of the Faculty of Arts at the University of St Andrews. Since the customary age for entering a Scottish university at this time was fourteen, a birth-date of 1459 or 1460 has been assumed. At Saint Andrews, he obtained a Bachelor's degree in 1477 and a Master's degree in 1479. Details from his later life suggest that he was ordained as a priest at some point, but the date is unknown. In 1491 and 1492 Dunbar accompanied an embassy to Denmark–Norway and France in an unknown capacity. In 1501 and 1502 he participated in an embassy to England in the staff of Bishop Andrew Forman of Moray. From 1500 the poet was employed at the court of James IV in a role for which he received an annual salary referred to as a pensioun. His duties are not recorded; he is referred to only as a servitour or servant; but it is to this period that the bulk of his poetry can be dated. Several of Dunbar's poems were included in the Chepman and Myllar prints of 1508, the first books to be printed in Scotland.