A utopia is an imagined ideal society; a dystopia an imagined terrible one. The pun buried in the first word is the interesting part: Thomas More built utopia from Greek ou-topos, "no place", which sounds identical to eu-topos, "good place". The perfect society is named for being nowhere.
The core difference
Opposite imagined societies, with the first coined as a joke.
- utopia — an imagined perfect society: More's Utopia (1516).
- dystopia — an imagined oppressive one: Nineteen Eighty-Four, Brave New World.
The built-in pun
More's coinage works both ways: ou-topos is "no place" and eu-topos is "good place", and in English they are indistinguishable. The name quietly says the ideal society does not exist — a scepticism the word has carried ever since, which is why "utopian" is often faintly dismissive.
Related terms
Eutopia is occasionally used for the genuinely good place, to disambiguate. Cacotopia, coined by Bentham, is an older word for what we now call a dystopia.