Shakespeare's main literary source for this play is the ninth tale of the third day of Giovanni Boccaccio's Decameron, a collection of one hundred tales, most of which are love stories with boatloads of dirty jokes (like the kind you find in Chaucer's "The Miller's Tale").
William Painter, The Palace of Pleasure (1595)
Shakespeare probably read Boccaccio's tale in an English translation that appeared in William Painter's book, The Palace of Pleasure.
All's Well That Ends Well has more internal references to its own title than any other Shakespeare play. Pretty cool. Here are some of our favorites:
Lavatch: "She is not well; but yet she has her health: She's very /merry; but yet she is not well. But thanks be given she's very / well and wants nothing i'th' world. But yet she is not well" (2.4.2-5).
Helen: "All's well that ends well; still the fine's the crown. / Whate'er the course, the end is the renown" (4.4.39-40).
Helen: "All's well that ends well yet, / Though time seem so adverse, and means unfit" (5.1.30-31).
King: "All yet seems well; and if it end so meet, / The bitter past, more welcome is the sweet" (5.3.378-379).
Epilogue: "The King's a beggar now the play is done. / All is well ended if this suit be won:" (Epilogue.1-2)