Foreshadowing or guessing ahead is a literary device by which an author explains certain plot developments that may come later in the story. It is used to arouse and mentally prepare the listener for how the story will proceed and unfold.
A hint that is designed to mislead the audience is referred to as a red herring. A similar device is the flashforward (also known as prolepsis). However, foreshadowing only hints at a possible outcome within the confinement of a narrative. A flashforward is a scene that takes the narrative forward in time from the current point of the story in literature, film, television, and other media.
- An example of foreshadowing from the book trilogy and its screen adaptation The Lord of the Rings:
—Frodo: What a pity that Bilbo did not stab that vile creature [Gollum/Smeagol], when he had a chance!
—Gandalf: Pity? It was pity that stayed his hand. [...] Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. [...] My heart tells me that he has some part to play yet, for good or ill, before the end; and when that comes, the pity of Bilbo may rule the fate of many – yours not least.
This conversation foreshadows the fact that later in the story Frodo himself pities Gollum and is unable to kill him. He has a last-minute change of heart against doing so. Gollum then inadvertently makes it possible to destroy the Ring, which is the whole point of Frodo's and the rest of the central characters' quest.
“Keep him!” she gasped. “He came naked, by night, alone and very hungry; yet he was not afraid! Look, he has pushed one of my babes to one side already. And that lame butcher would have killed him and would have run off to the Waingunga while the villagers here hunted through all our lairs in revenge! Keep him? Assuredly I will keep him. Lie still, little frog. O thou Mowgli –for Mowgli the Frog I will call thee–the time will come when thou wilt hunt Shere Khan as he has hunted thee.”
- Foreshadowing is used in much of the works of John Steinbeck. In Of Mice and Men, Lennie accidentally kills a mouse, a puppy dog and finally Curley's Wife. This foreshadows his own death. When Carlson kills Candy's Dog, Candy told George, "I ought to of shot that dog myself" making George later chose to kill Lennie himself to save him from dying by the hands of a stranger. Doing it the way that Carlson did it was for the best because, "He won't even feel it." 
- Foreshadowing can be carried out by characters predicting the future. Cassandra in The Iliad has the explicit ability to foresee the future and make a prophecy. She predicts that her son will come to a bad end[which?] if he doesn't change his ways or character.[how?] Similarly, omens, such as breaking a mirror, can be used to foreshadow bad luck.
- Mogensen (2009). Along Literary Lines. Gyldendal. p. 55. ISBN 8702056178.
- Author's Craft - "Narrative Elements - Foreshadowing" Retrieved 2013-07-18
- Nicola Onyett (30 November 2012). Philip Allan Literature Guide (for A-Level): A Streetcar Named Desire. Hodder Education. p. 50. ISBN 978-1-4441-5376-7. Retrieved 18 July 2013.
- Ulrike Spierling; Nicolas Szilas (3 December 2008). Interactive Storytelling: First Joint International Conference on Interactive Digital Storytelling, ICIDS 2008 Erfurt, Germany, November 26-29, 2008, Proceedings. Springer. p. 156. ISBN 978-3-540-89424-7.
- flash-forward - definition of flash-forward by the Free Online Dictionary, Thesaurus and Encyclopedia
- J.R.R. Tokien, The Fellowship of the Ring, p 68, ISBN 0-261-10231-1
- John Steinbeck, Of Mice and Men, p 61, ISBN 9783125785021
- Philip Martin, The Writer's Guide to Fantasy Literature: From Dragon's Lair to Hero's Quest, p 146, ISBN 0-87116-195-8