September 8 will be the 50th anniversary of Star Trek. On that date on 1966, the show aired its first episode. Let me get out ahead of the inevitable retrospectives of the show with the 50 top TV episodes of the 50 years, as decreed by sources ranging from Playboy.com to Britain’s Radio Times.

Links to these sources are at the bottom of this post. I compiled this master list by noting which episodes ranked the highest by the most sources.

You won’t find “These Are the Voyages” (Enterprise), “Threshold” (Voyager), “Code of Honor” (The Next Generation), “Spock’s Brain” (the original series) or “Profit and Lace” (Deep Space Nine) — episodes almost universally considered stinkers — on this list. Nor will you find anything from the animated series, which seems to have been largely forgotten, or from the feature films.

But what you see here are, by common consensus, the best Star Trek TV episodes.

  1. “The City on the Edge of Forever” (the original series)

Written by Harlan Ellison

Directed by Joseph Pevney

Captain Kirk and Mr. Spock visit the 1930s to find a drug-crazed Dr. McCoy, who has wiped out the characters’ timeline by saving the life of visionary pacifist (and hottie) Edith Keeler. Joan Collins, later typecast as a scheming strumpet, played the “Slum Area ‘Angel,’” as a newspaper headline in the episode called her. After Kirk falls in love with Keeler, Spock reveals that Kirk must let her die; if she lives, she will change world history, the Nazis will win World War II, and virtually everyone whom Kirk and Spock have ever known will cease to exist. The episode is thought-provoking, well acted, visually handsome, and even, in spots, pretty funny.

  1. “Space Seed” (the original series)

Written by Gene L. Coon and Carey Wilbur

Directed by Marc Daniels

This episode inspired Star Trek II: The Wrath of Khan, one of the best Star Trek feature films, not to mention Star Trek Into Darkness. The genetically superior, long-hibernating Khan Noonien Singh, says Spock, used to be “absolute ruler of more than a quarter of your world.” And now he’s aboard the Enterprise, awake and planning to use the ship to conquer the galaxy. The episode delivers rich conflict between Kirk’s humanitarian approach and Khan’s brutal ambition, and Ricardo Montalban plays the charismatic, ruthless superman with convincing power.

  1. and 4. “The Best of Both Worlds,” parts 1 and 2 (The Next Generation)

Written by Michael Piller

Directed by Cliff Bole

Captain Jean-Luc Picard becomes a soulless Borg! His second-in-command gets his own ship (if he chooses to accept it) while facing a hard-charging rival! The Borg destroy a fleet of starships and close in on Earth! This two-parter, which aired as the last episode of one season and the first episode of the next, offered strong emotions without melodrama or mawkishness, and offered a satisfying solution to the over-used “hive mind attacks human individuality” type of story.

  1. “The Visitor” (Deep Space Nine)

Written by Michael Taylor

Directed by David Livingston

Deep Space 9’s commander, Benjamin Sisko, dies as his teenage son Jake watches. But as years pass, Sisko keeps reappearing to Jake. Turns out that Sisko’s in a time trap, but Jake can’t do anything about it for decades – during which he becomes so obsessed with freeing his dad that he loses his career and marriage. At the end of Jake’s life, they’re reunited and get a chance to start over. This tale of father and son is one of the most heartfelt love stories in Trek history.

  1. “The Trouble with Tribbles” (the original series)

Written by David Gerrold

Directed by Joseph Pevney

The animated series and Deep Space Nine did sequels to this one, the funniest of Trek episodes, and Star Trek Beyond included one of its little furry stars. Written by a young newcomer, it features Kirk versus Klingons, civilian bureaucrats, thousands of adorable creatures – and, occasionally, his own crew. And it gives William Shatner, whose dramatics have sometimes made viewers laugh, a chance to make them laugh on purpose, a task at which he succeeds beautifully.

  1. “In the Pale Moonlight” (Deep Space Nine)

Story by Peter Allan Fields; teleplay by Michael Taylor

Directed by Victor Lobl

This may be the morally darkest of all Star Trek tales. The noble Captain Sisko tries to trick the shrewd and powerful Romulans into joining the Federation’s side in a war — but nothing so dangerous is simple. To keep his plot from unraveling, Sisko steps over one ethical line, then another, then another. As he confesses, “I lied. I cheated. I bribed men to cover the crimes of other men. I am an accessory to murder. But the most damning thing of all . . . I think I can live with it.”

  1. “The Inner Light” (The Next Generation)

Story by Morgan Gendel; teleplay by Morgan Gendel and Peter Allan Fields

Directed by Peter Lauritson

After an alien probe hits Captain Picard on the bridge of the Enterprise, he passes the next half-hour of “real-world” Enterprise time inside his own mind, living 40 years on another planet as a family man. The probe is filling his mind with memories of a long-lost world so that he will tell about it and keep it from being forgotten. When he regains consciousness, Picard returns to his captainly duties – but he can’t forget his emotionally rich years in another man’s life.

  1. “Mirror, Mirror” (the original series)

Written by Jerome Bixby

Directed by Marc Daniels

The one with Spock’s beard. Kirk, McCoy, chief engineer Scott, and communications officer Uhura drop into a parallel universe where the Enterprise serves an evil empire, not the egalitarian Federation. Our heroes have to impersonate their evil-universe counterparts and avoid being exposed as good guys while they try to return to their own universe. This episode has spawned all kinds of pop-culture parodies and lampoons.

  1. “The Measure of a Man” (The Next Generation)

Written by Melinda M. Snodgrass

Directed by Robert Scheerer

Mr. Data is a machine, but is he property? A Federation officer wants to replicate him, but the Enterprise’s supposedly emotionless android refuses. A trial ensues to determine what he is, pushing Captain Picard to the impossible task of proving that Data has a soul while his second-in-command (and Data’s friend) Will Riker has to prove that Data is just a thing — and Riker’s very good at his job.

The other 40:

  1. “Yesterday’s Enterprise” (The Next Generation)
  2. “Darmok” (The Next Generation)
  3. “Trials & Tribble-ations” (Deep Space Nine)
  4. “Balance of Terror” (the original series)
  5. “Year of Hell, Part 1” (Voyager)
  6. “All Good Things…” (The Next Generation)
  7. “Year of Hell, Part 2” (Voyager)
  8. “Chain of Command, Part 2” (The Next Generation)
  9. “Duet” (Deep Space Nine)
  10. “Chain of Command, Part 1” (The Next Generation)
  11. “Amok Time” (the original series)
  12. “Tapestry” (The Next Generation)
  13. “The Devil in the Dark” (the original series)
  14. “The Doomsday Machine” (the original series)
  15. “Far Beyond the Stars” (Deep Space Nine)
  16. “In a Mirror, Darkly, Part 1” (Enterprise)
  17. “In a Mirror, Darkly, Part 2” (Enterprise)
  18. “What You Leave Behind” (Deep Space Nine)
  19. “Arena” (the original series)
  1. “Broken Bow” (Enterprise)
  2. “Q Who” (The Next Generation)
  3. “Where No Man Has Gone Before” (the original series)
  4. “Blink of an Eye” (Voyager)
  5. “The Way of the Warrior” (Deep Space Nine)
  6. “Living Witness” (Voyager)
  7. “Unification” (The Next Generation)
  8. “Family” (The Next Generation)
  9. “Sacrifice of Angels” (Deep Space Nine)
  10. “Deja Q” (The Next Generation)
  1. “Relics” (The Next Generation)
  2. “The Enterprise Incident” (the original series)
  3. “Lower Decks” (The Next Generation)
  4. “Equinox, Part 1” (Voyager)
  5. “Timeless” (Voyager)
  6. “The Offspring” (The Next Generation)
  7. “Scorpion, Part 1” (Voyager)
  8. “Scorpion, Part 2” (Voyager)
  9. “Twilight” (Enterprise)
  10. “This Side of Paradise” (the original series)
  1. “Cause and Effect” (The Next Generation)