Science fiction is a genre of fiction with imaginative but more or less plausible content such as settings in the future, futuristic science and technology, space travel, parallel universes, aliens, and paranormal abilities. Exploring the consequences of scientific innovations is one purpose of science fiction, making it a "literature of ideas". Science fiction has been used by authors and film/television program makers as a device to discuss philosophical ideas such as identity, desire, morality and social structure etc.
Science fiction is largely based on writing rationally about alternative possible worlds or futures. It is similar to, but differs from fantasy in that, within the context of the story, its imaginary elements are largely possible within scientifically established or scientifically postulated laws of nature (though some elements in a story might still be pure imaginative speculation).
The settings for science fiction are often contrary to consensus reality, but most science fiction relies on a considerable degree of suspension of disbelief, which is facilitated in the reader's mind by potential scientific explanations or solutions to various fictional elements. Science fiction elements include:
A time setting in the future, in alternative timelines, or in a historical past that contradicts known facts of history or the archaeological record.
A spatial setting or scenes in outer space (e.g. spaceflight), on other worlds, or on subterranean earth.
Characters that include aliens, mutants, androids, or humanoid robots.
Futuristic technology such as ray guns, teleportation machines, and humanoid computers.
Scientific principles that are new or that contradict accepted laws of nature, for example time travel, wormholes, or faster-than-light travel.
New and different political or social systems, e.g. dystopian, post-scarcity, or post-apocalyptic.
Paranormal abilities such as mind control, telepathy, telekinesis, and teleportation.
Other universes or dimensions and travel between them.
Source: Wikipedia, "Science fiction", available under the CC-BY-SA License.