Recently Variety came out with a list of the best Star Trek episodes (you can see it here), which was surprisingly decent, but I thought it could have been punched up a little. So here's what my list looks like, although it's not a ranking but rather listing by each series (it's worth noting I would probably agree with Variety's pick for overall best episode).
"The Menagerie, Parts 1 & 2" (Star Trek: The Original Series 1x11, 1x12)
Very brilliantly incorporating the original pilot with its own lead character, Pike (which sets him up for an enduring legacy later unfolding in the J.J. Abrams films, Discovery, and Strange New Worlds) into the franchise's first two-part episode, it's if nothing else a functional embodiment of the kind of frugal ingenuity the original series would often have to work around on its shoestring budget.
"Balance of Terror" (Star Trek: The Original Series 1x14)
Star Trek is best known as a franchise where weird science fiction happens, and yet from very close to the very beginning the franchise proved it had a lot more ambition, tapping into real world events with allegorical takes that even for their time would've seemed impossible in any other context. The presence of a black woman and Japanese man in important roles on the bridge had already sent signals in this regard, but tackling the Cold War only a few years removed from its harrowing peak (the Cuban Missile Crisis) in "Balance of Terror" by essentially saying Americans and Russians could probably still get along if they could just stop viewing each other as mortal enemies...Because, yeah, that's what's really going on in Kirk's showdown with a Romulan warship.
"City on the Edge of Forever" (Star Trek: The Original Series 1x28)
It wasn't just finding its own distinct audience but winning over the sci-fi mainstream that established Star Trek's long-term potential, and that's exactly what was accomplished with "City," written by acclaimed sci-fi writer Harlan Ellison, which Ellison himself made an important part of his own legacy by insisting for years that his version was better than the beloved episode that ultimately resulted from the production process, in which Kirk tragically must allow an idealist to die in order to preserve the timeline. Not much in the way of romance, but Edith Keeler will probably remain his most notable dalliance, in any incarnation.
"Mirror, Mirror" (Star Trek: The Original Series 2x4)
If Star Trek must be known for weird sci-fi, then at least let it have awesome consequences, such as this memorable visit to an alternate timeline, in which all our favorite characters have been turned into their evil counterparts, giving Kirk a chance to inspire even the irredeemable and therefore once again living up to the franchise's impossible ideals. Later inspires storytelling in Deep Space Nine, Enterprise, and Discovery to highly fruitful results.
"The Trouble with Tribbles" (Star Trek: The Original Series 2x15)
The original series didn't take itself too seriously (by its third and final season, many fans began to wonder if this was indeed a fatal impulse), and this comic romp pitting Kirk against Klingons and a surprising nuisance is by far the high water mark in that vein, setting a standard not matched until...Well, it'll come up, don't worry.
"Yesteryear" (Star Trek: The Animated Series 1x2)
The very brief animated adventures distilled the original premise to its most basic form, leaving little room for the very human delights of the characters themselves, with one notable exception: this peek behind the curtain of Spock's childhood that would later inform the J.J. Abrams version of the character in Star Trek.
"The Measure of a Man" (Star Trek: The Next Generation 2x9)
The first season of the new generation was raw, lacking direction, distrustful of its finest elements, all of which was completely reversed in "Measure," in which Data is explored at the benefit of both Picard and Riker around him as his very existence is put on trial, with all three, to their adject horror (for each of them, very different reasons), forced to participate. The most sophisticated episode of the franchise itself to that point, proving the more cerebral tone set by Picard was not, after all, a mistake.
"The Defector" (Star Trek: The Next Generation 3x10)
With its own identity settled, the series could return to the idea of the first season, which was to see if it could rephrase the stories of the original series in a fruitful manner, and "Defector" is essentially exactly that, "Balance of Terror" revisited, a Romulan getting to see just how far they can push their luck when the Cold War was still relevant, in its last days, in fact. Star Trek taking a victory lap.
"Sarek" (Star Trek: The Next Generation 3x23)
Another of the walls that needed definitively knocking down (although it's worth noting an unrecognizable McCoy does appear in the pilot) was embracing the most familiar elements of the original series, and finding a way to make them newly relevant, which is what happens when Spock's dad passes the torch to Picard (in the process allowing Patrick Stewart some meaty acting). Allowing Sarek to stand on his own, rather than adjacent to his son, is mere bonus.
"The Wounded" (Star Trek: The Next Generation 4x12)
Foreshadowing Deep Space Nine in more ways than one by introducing the Cardassians (completely with Dukat actor Marc Alaimo in an unrelated role), "Wounded" allows a supporting cast member to truly embrace the spotlight as Miles O'Brien is tasked with handling a former commanding officer who has gone off on one of those revenge plots that pop up frequently in the franchise. Arguably Colm Meaney's best moment in the role and franchise.
"The Inner Light" (Star Trek: The Next Generation 5x25)
"City on the Edge of Forever" set up a precedent for transcendent experiences that the franchise eagerly pursued for years, leading to episodes like "Inner Light," in which Picard finds himself living a whole alternate life he at first resists but gradually comes to embrace as the audience itself learns this is no sinister plot but epiphany filled with the simple pleasures about the mere act of living.
"Chain of Command, Part 2" (Star Trek: The Next Generation 6x11)
The casting of Patrick Stewart as Picard was always a double-edged sword, a brilliant Shakespearean actor often seeking material truly worthy of his talents (and too many critics secretly believing the material was never truly up to it). The argument against that assumption begins with Picard's desperate series of interrogations opposite a sadistic but equally elegant Cardassian foil, played by frequent Star Trek guest actor David Warner, which allow Stewart to truly cut loose.
"Ship in a Bottle" (Star Trek: The Next Generation 6x12)
Too easy to overlook in later years, Picard (and crew) have a cunning foe, and moral dilemma, in the form of the holographic Moriarty first introduced in the second season and at last revisited late in the series, tackling existential matters somehow unaddressed by Data or even Voyager's holographic Doctor, both of whom would be dazzled by Mortiarty's subtle wit.
"Tapestry" (Star Trek: The Next Generation 6x15)
And yet Picard's greatest foil was neither elegant nor subtle (and yet, paradoxically, was both whenever he sought a mere verbal joust), and Q reaches his finest moment in "Tapestry," in which he serves as guide to Picard's chance to rethink his life's greatest regret, an event so terrible it turned the track of his life from something resembling Kirk to, well, the Picard who proved so inspiring they literally wrote a leadership book based on him.
"Duet" (Star Trek: Deep Space Nine 1x19)
Star Trek fans can be slow to embrace new crews, and Deep Space Nine was no exception (contrary to popular belief, the serialized Dominion arc of later seasons never really changed the overall impression among casual fans), but "Duet" was an early and obvious standout, in which Kira is forced to confront her racial prejudices when she meets what even she must admit is a good Cardassian.
"Necessary Evil" (Star Trek: Deep Space Nine 2x8)
The intellectual bent of its immediate predecessor gave the series the ability to explore many shades of gray, which led to another standout Kira spotlight, in which her background as a terrorist is explored in ways that complicate her relationship with Odo, even as they begin the slow process of inextricably linking them together for the duration of the series.
"Blood Oath" (Star Trek: Deep Space Nine 2x19)
The improbable return of not one but three Klingons, and the actors who played them, from the original series is proof how far the franchise had come in sophistication, as Dax finds herself compelled to fulfil an oath her previous host made with them.
"The Wire" (Star Trek: Deep Space Nine 2x22)
It took a few seasons, but the series began to truly embrace the nature of its stationary existence by settling into the lives of the many strange denizens both resident and visitor, none more fascinating than the "plain, simple tailor" Garak, whose secrets, though of course never fully revealed, burst forth in "Wire" to the utter consternation and fascination of Bashir.
"Crossover" (Star Trek: Deep Space Nine 2x23)
The first time the series, and franchise, revisits "Mirror, Mirror" subverts every happy expectation from that episode's conclusion, and in the process setting up a recurring arc and proving how valuable that alternate timeline really is in exploring our dark potential, as well as our redeeming impulses, thereby proving "Crossover" doesn't spoil that ending but rather affirms Star Trek's ideals all over again (the series itself in a nutshell, by the way).
"Civil Defense" (Star Trek: Deep Space Nine 3x7)
Life aboard the station, once Cardassian and now under joint Federation/Bajoran control, came with its own peculiar complications, especially when a security subroutine is triggered and a self-destruct sequence begins, causing everyone to scramble to avert it, including Dukat, whose usual pompous attitude has its best spotlight, including a moment even he wouldn't be able to deny as definitively piercing it. Probably.
"Past Tense, Parts 1 & 2" (Star Trek: Deep Space Nine 3x11, 3x12)
Not so much "City on the Edge of Forever" as it became a touchstone, but in how it presented the past as a chance to criticize our present, Sisko finding himself at the heart of riots centered on the plight of the homeless, a predicament still very much relevant today, alas.
"Explorers" (Star Trek: Deep Space Nine 3x22)
It took until the third season, but once the series knew what to do with Sisko, he became the indisputable center of its best storytelling. This episode draws on Sisko and his son, an experience they share free from typical drama as they build an ancient Bajoran solar ship just to prove it can be done, and the surprising results, both personal and galactic, that follow.
"The Visitor" (Star Trek: Deep Space Nine 4x3)
Sisko and son receive their definitive spotlight in one of those "City" episodes, a reset button designed to provide maximum emotional impact as Jake loses his dad unexpectedly, but discovers he can get him back, if he's willing to make the ultimate sacrifice, which takes a lifetime we get to see play out in all its bitter tragedy. Variety's, and mine, pick for best episode of the franchise.
"Trials and Tribble-ations" (Star Trek: Deep Space Nine 5x6)
The series chased the comedic whimsy of the original Tribble episode throughout its run, mostly with the Ferengi, but this one's the most successful, in part because it lets loose so completely, free from any greater significance than sharing memories and having fun.
"For the Uniform" (Star Trek: Deep Space Nine 5x13)
It's easy to assume Sisko's greatest enemy was Dukat, Winn, or the whole Dominion, but it's really Eddington, who betrayed him to join the Maquis, and this whole episode is the revenge plot writ large, arguably the best example of the idea in the entire franchise. If you ever wondered what a Deep Space Nine movie would look like, this is it.
"Waltz" (Star Trek: Deep Space Nine 6x11)
In the final episode of the series, Sisko and Dukat finally square off, physically, but their battle of wits never really gets better than "Waltz," in which a Dukat driven to despair by the death of his daughter (forget hiccups in the Dominion War that surround it) has Sisko at his mercy, but can't seal the deal.
"Far Beyond the Stars" (Star Trek: Deep Space Nine 6x13)
Too easily dismissed as too on the nose, Sisko's vivid experience of a black man's difficulties with segregation remains all too relevant today.
"In the Pale Moonlight" (Star Trek: Deep Space Nine 6x19)
The episode that settled into the series highlight for most fans sees Sisko making moral compromises in order to gain advantages in the increasingly desperate Dominion War, and appearing to be the first Star Trek character to reject the notion of being a saint in paradise.
"Maneuvers" (Star Trek: Voyager 2x11)
Arguably the peak of the original vision for the next series, Chakotay finds himself in the clutches of Seska, who has betrayed the crew and attempted to leverage her relationship with him in order to solidify her place among the Kazon.
"Tuvix" (Star Trek: Voyager 2x24)
What ultimately defined this series was its willingness to let Janeway make the hard decisions, which she started doing in the pilot itself, stranding her crew an impossible distance away from home based on moral principles alone. "Tuvix" inverts this idea by confronting Janeway with a scenario that betrays the audience's own concept of the franchise's ideals, even though Star Trek had been telling similar stories from the very start.
"Distant Origin" (Star Trek: Voyager 3x23)
One of its finest episodes saw the series remove nearly every trace of the usual trappings by having Chakotay taken prisoner by a species who spend "Origin" tackling an analogy for humanity's own reluctance to accept new science.
"Worst Case Scenario" (Star Trek: Voyager 3x25)
By the third season the series had all but abandoned any further dramatic complications from Janeway's decision to merge a stranded Maquis crew with her own; "Scenario" finds Paris triggering a holodeck program that allows everyone to see just how badly it might have played out.
"Message in a Bottle" (Star Trek: Voyager 4x14)
The Doctor proved to be one of the standout characters of the series, and incredibly useful any number of ways, including this first contact with home territory in which his program is sent to an experimental new Starfleet ship, in which he meets a very different medical hologram and the two somehow manage to save the day despite their glaring inexperience with such matters. Arguably the best non-Tribble comedy of the franchise.
"Living Witness" (Star Trek: Voyager 4x23)
With a huge debt to "Distant Origin" before it, "Witness" again takes a look outside the usual parameters, sticking a backup version of the Doctor in a scenario where he must somehow defend his crew against a historical misperception of its adventures.
"Timeless" (Star Trek: Voyager 5x6)
The series' "City," in which Kim and Chakotay, in the near future, are somehow unhappy that the crew did get home, because of cost at doing so, which leads them on a quest to undo it.
"Latent Image" (Star Trek: Voyager 5x11)
One last Doctor spotlight, in which the crew must face its own reluctance to allow his programming to expand far beyond its original parameters, so he can learn from his own mistakes, a heartbreaking inability, as it turns out, to reconcile his own thought process.
"Cold Front" (Star Trek: Enterprise 1x11)
The series that followed tried to have its cake and eat it, too, with fans uncomfortable with looking backward instead of forward, a prequel to a century before Kirk when Starfleet was just getting its space legs, but with Archer also embroiled in a Temporal Cold War that looked far into the future, and the natural consequences of the frequent time travel trope of the franchise. "Cold Front" is the shining moment of the arc, in which Archer confronts two separate yet equally inscrutable agents, Silik and Daniels, one of whom is already clearly his enemy, the other proving he is a friend. Yet Archer will never quite be happy being pulled into the conflict. Launched in the wake of 9/11, the series found itself having to address a new era, and eventually discovered its premise had already made room for it, as our own times make clear.
"A Night in Sickbay" (Star Trek: Enterprise 2x4)
Typically considered one of the worst episodes of the series (this will not be the only time I buck this trend), "Sickbay," for me, is an excellent way to understand Archer's struggles to understand where humans fit among alien cultures, his bewilderment but eventual ability to navigate the stars his successors so often take for granted.
"Twilight" (Star Trek: Enterprise 3x8)
The series' "City," in which Archer is confronted with a reality where his long-term memory is shot, and he still has to try and find a solution to the Xindi conflict, with the unexpected patience of T'Pol his only asset.
"Similitude" (Star Trek: Enterprise 3x10)
For me, there's no question that Trip was the best character in the series. Here he finds himself (or a version of himself does) in an impossible moral dilemma that pushes him to his very limits.
"Stratagem" (Star Trek: Enterprise 3x14)
The whole third season was one long arc revolving around the Xindi conflict, and this is the episode it pivots around, in which Archer must somehow convince Degra to betray his own people in order to help him find a way to victory.
"These Are the Voyages..." (Star Trek: Enterprise 4x22)
Like "Sickbay," more typically considered one of the worst episodes, even for the whole franchise, but I just never saw it that way. I thought it was a celebration of Trip, just when everyone would've assumed that honor should fall to Archer, in the final episode of the series, that also pulls in Riker and Troi from Next Generation to try and give some overall context (and an otherwise impossible visit from familiar faces), in which Trip chooses to sacrifice himself so Archer can make history. To my mind, profound on a lot of levels, but as with the best of Star Trek, at the human one most and best of all. The scene immediately following his death, Trip gets to have the last word on his life anyway.
"An Obol for Charon" (Star Trek: Discovery 2x4)
For a series that pushed the idea of genius-level Starfleet crews so heavily, this episode displays that alone the best the first of the modern versions has so far accomplished. But the true achievement is in finding a connection between Saru and Burnham right when it seems most impossible. I still want a Hallmark ornament commemorating it.
"Absolute Candor" (Star Trek: Picard 1x4)
The idea of further adventures featuring Picard seemed for years to be a pipedream, and yet for three seasons it was a reality. Early on he's given the chance to find new allies among the Romulans, his (and the franchise's) most implacable foe, and he gets to get a little sword-fighting in while doing so.
"Et in Arcadia Ego, Part 2" (Star Trek: Picard 1x10)
The series slowly but deliberately made amends for many perceived sins of the past, including the culminating of the first season's elegy for Data in allowing him to end (a version of) his existence more squarely on his own terms.
"Kayshon, His Eyes Open" (Star Trek: Lower Decks 2x2)
The sheer spastic lunacy of references populating this animated comedy hits a high point in one of its perfect moments, when the Next Generation episode "Darmok" is revisited in the most unlikely of ways.
"We'll Always Have Tom Paris" (Star Trek: Lower Decks 2x3)
Boimler meets one of his idols, and Voyager has a hilarious callback to its earliest seasons, suggesting how deep this farce (I say in the best possible sense) of a franchise love letter can cut.
"All the World's a Stage" (Star Trek: Prodigy 1x13)
Once this kid version of Star Trek finally settled into itself, it could finally just tell Star Trek stories, and this one happens to be a very good one, in which our unlikely crew is confronted with a version of its own dilemma.
"A Quality of Mercy" (Star Trek: Strange New Worlds 1x10)
The franchise truly comes full circle in this delightful further exploration of Pike's having learned his impending fate, and in the process of deciding just how horrified he is of it, "Balance of Terror" is echoed.
"Tomorrow and Tomorrow and Tomorrow" (Star Trek: Strange New Worlds 2x3)
Like the preceding episode, "Tomorrow" features a rare series appearance from Kirk, and yet it's La'an who is and who steals the spotlight, basically of the whole series, as she confronts the specter of her own past, which just so happens to revolve around the arch franchise villain, Khan.