In fiction, canon is the material accepted as officially part of the story in the fictional universe of that story. It is often contrasted with, or used as the basis for, works of fan fiction. The alternative terms mythology, timeline, universe and continuity are often used, with the former being especially used to refer to a richly detailed fictional canon requiring a large degree of suspension of disbelief (e.g. an entire imaginary world and history), while the latter two typically refer to a single arc where all events are directly connected chronologically. Other times, the word can mean "to be acknowledged by the creator(s)."
The use of the word "canon" originated in reference to a set of texts derives from Biblical canon, the set of books regarded as scripture, as contrasted with non-canonical Apocrypha. The term was first used by analogy in the context of fiction to refer to the Sherlock Holmes stories and novels, written by Sir Arthur Conan Doyle, as contrasted with numerous Holmes adventures added later by other writers. This usage was afterwards extended to the writings of various other authors.
The term "canon" nowadays refers to all works of fiction within a franchise's fictional universe which are considered "to have actually happened" within the fictional universe they belong to.
When there are multiple "official" works or original media, the question of what is and what is not canonical can be unclear. This is resolved either by explicitly excluding certain media from the status of canon (as in the case of Star Trek and Star Wars), by assigning different levels of canonicity to different media (as was in the case of Star Wars before the franchise was purchased by Disney), by considering different but licensed media treatments official and equally canonical to the series timeline within their own continuities universe, but not across them, or not resolved at all. The use of canon is of particular importance with regard to reboots or re-imaginings of established franchises, such as the 2009 Star Trek film, because of the ways in which it influences the viewer experience.