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). Science fiction is largely based on writing rationally about alternative possible worlds or futures. Science fiction has been used by authors as a device to discuss philosophical ideas such as identity, desire, morality, and social structure. Exploring the consequences of scientific innovations is one purpose of science fiction, making it a "literature of ideas".
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.