It is unknown exactly when A Midsummer Night's Dream was written or first performed, but on the basis of topical references and an allusion to Edmund Spenser's Epithalamion, it is usually dated 1595 or early 1596. Some have theorised that the play might have been written for an aristocratic wedding (for example that of Elizabeth Carey, Lady Berkeley), while others suggest that it was written for the Queen to celebrate the feast day of St. John, but no evidence exists to support this theory. In any case, it would have been performed at The Theatre and, later, The Globe. Though it is not a translation or adaptation of an earlier work, various sources such as Ovid's Metamorphoses and Chaucer's "The Knight's Tale" served as inspiration. According to John Twyning, the play's plot of four lovers undergoing a trial in the woods was intended as a "riff" on Der Busant, a Middle High German poem.
According to Dorothea Kehler, the writing period can be placed between 1594 and 1596, which means that Shakespeare had probably already completed Romeo and Juliet and was still in contemplation of The Merchant of Venice. The play belongs to the early-middle period of the author, a time when Shakespeare devoted primary attention to the lyricism of his works.