Fan fiction (commonly abbreviated to "fanfic") is pastichefiction written by people who enjoy a film, novel, television show or other dramatic or literary work, using the characters and situations developed in it and developing new plots in which to use these characters.

Fan fiction has come to the fore especially since the rise of the Internet, where it flourishes despite the possibility that it infringes the copyright of the film, book, TV show, or other media on which it is based.

A large subsection of fanfiction revolves around romantic and/or sexual relationships between characters, almost always outside the canon of the source material and often dealt with in explicit detail (see slash fiction).

It is worth noting that there is no such thing as an "original fanfic." The term is a misnomer that is sometimes applied to completely original works published on-line. It is inaccurate, however, because the work is not based on any previously existing story. Not all amateur fiction is fan fiction, regardless of the fact that the popular site Fanfiction.net has a section for original works.

Fan fiction also exists in film and video, in the form of independent, fan-produced pastiches and parodies of established works. One of the best known is Troops[?], a parody of the reality television show Cops starring Star Wars storm troopers on patrol.

Whether fan fiction actually infringes copyright is a matter of some debate.

According to current copyright laws, fan fiction is a "derivative work" of the story on which it is based. Copyright owners have the right to control or restrict the publishing of derivative works, though they do not receive ownership of those works. The owner of the original work (film, TV show, etc.) therefore has legal power over fanfic. (An exception to this is parody fanfic, since parodies are granted special status as fair use under copyright law.)

Many characters in American television and film productions are also registered trademarks of the producing company.

Others argue that fanfic does not reduce the income which the original authors can extract for their work, and the authors of the fanfic receive little or no income from it, though under the law copyright (and trademark) infringement still occurs even when the infringer does not profit from it. Thus far, the major studios have generally tolerated fan fiction. A noted exception is Lucasfilm which has threatened or sued many sites precisely because of their non-commercial nature. Some studios, besides turning a blind eye to fanfic, even surreptitiously encourage it because they believe it helps them by maintaining fans' (customers') interest.