The nicest thing about television, at least when it comes to end-of-year lists, is that even when shows disappoint — and over seasons and years, many end up disappointing at some point or another — they can still produce a beautiful episode every now and again, an installment of story that twists familiar characters into a scenario that challenges, surprises, and delights. Inconsistency in a show can be maddening, of course, in its own way. But the inherent unevenness of television also makes space for moments of brilliance in the midst of mediocrity.

I particularly love honoring the best episodes of the season, because while my favorite shows are often full of favorite episodes (choosing just one favorite episode from “Atlanta” was a tough quandary this year), it’s a chance to recognize standalone moments in shows that might not have otherwise quite risen to the level of our top 10 lists. Episodes also emphasize structure and precision — qualities that some television shows in our current era of peak TV quickly lose sight of. And when trying to take stock of the year past, episodes are a way of singling out moments that mattered amidst all the noise — when, ever so briefly, the chatter of social media, the hype of marketing, and the competing narratives of every other show out there fall away long enough for a scene, a creative decision, a 25-minute long premise to find its way under your skin.

That being said, this wasn’t quite the year for breakout episodes. Most of my choices below are installments in already well-regarded shows; drama has had an off year, and it’s reflected in the kinds of episodes that made it into this list. Nearly all of this list can be boiled down to either half-hour installments with a strong conceit from shows that I already liked, or an especially forceful episode from a period drama that prominently features at least one female character. Some of that speaks to my own biases, but some of that, too, speaks to how the television landscape is currently working a couple of angles very well — while leaving the rest of its potential territory unclaimed.

Still, while there’s always room for improvement and expansion, episodes like these are a reminder of just how wonderful television can be, whether through one-off greatness or a succession of brilliant installments. Here are the top 20 episodes of the year, ranked.

20. “Better Things,” “Scary Fun” (FX): Pamela Adlon’s FX comedy, in which she plays single mom Sam trying to raise three uniquely lovable and flawed daughters, has a muted intimacy that sneaks up on the viewer, and sometimes just meanders without resolution. But “Scary Fun” is the pinnacle of the show’s accomplishment — a portrait of hard-won, weirdly specific togetherness, centered around Halloween with the girls.

19. “Broad City,” “Burning Bridges” (Comedy Central): “Broad City” is not a comedy that leans too hard on plot, but “Burning Bridges,” where Ilana and Abbi experience a rare moment of disconnect, is almost all story. Ilana and Abbi are hilarious when they’re in sync; out of sync, it starts funny and becomes rapidly tragic. The convoluted way in which they find their way to the truth is the highlight of the season.

18. “Girls,” “Panic in Central Park” (HBO): HBO’s comedy has become mostly irrelevant of late, but this season five episode was a shot of energy. Marnie, hastily married and as clueless as ever, is jarred out of her patterns when ex-boyfriend Charlie meanders back into her life. But both have changed, and the two move through the ecstasy of reunion and shock of rediscovery over one evening before Marnie returns to her husband and her life.

17. “The Carmichael Show,” “Fallen Heroes” (NBC): It is not easy to tackle the topic of Bill Cosby’s legacy, but “The Carmichael Show” managed to make it funny — in a heartfelt way, for if there is any sitcom that the current NBC show is based on, it is “The Cosby Show,” that multi-camera family sitcom anchored by one mugging comedian and a laugh track. There really isn’t a show better than “The Carmichael Show” at tackling hot topics — and in “Fallen Heroes,” the Carmichael family learns to grapple with and laugh over the process of losing faith in a childhood hero.

16. “Looking: The Movie” (HBO): Okay, so it’s not exactly an episode. But this feature-length finale to “Looking,” Andrew Haigh’s series about queer coming of age in San Francisco, is a gorgeous installment of television and a fitting ending to the show. Jonathan Groff is at his very best as Patrick, and though the arc of the episode might be predictable, watching it unfold so sweetly is still a joy to behold.

15. “The Night Of,” “The Beach” (HBO): “The Night Of” didn’t quite stick its landing, but the opening episode — “The Beach” — is one of the most tense installments of the year, as innocent-seeming Naz starts a journey with unrecognizable, far-off consequences. Part of the episode’s strength is just how carefully it introduces its ambiguity to the audience; the rest comes in how carefully it introduces Naz, set against the gorgeous noir of New York City at night.

14. “Better Call Saul,” “Klick” (AMC): Although the entirety of “Better Call Saul” proceeds with more tense poise than any other show on television, the season two finale — which closes with Chuck revealing just how faithless and paranoid he is, when it comes to his brother Jimmy — ends with a particularly stinging thud that still reverberates.

13.  “Veep,” “Kissing Your Sister” (HBO): Just before “Veep” kicked its protagonist out of politics — for now — it showcased her much-ignored daughter Catherine’s documentary film project, a perspective-switching faux-film that is even more devastatingly revealing than an average episode of “Veep.” It’s in line with what former showrunner Armando Iannucci did with both “The Thick of It” and earlier seasons of “Veep”; with this new season’s genre-bending and confidence, it has demonstrated how confidently David Mandel has stepped into the role of showrunner.

12. “Superstore,” “Labor” (NBC): In the NBC sitcom’s Season 1 finale, Cheyenne has her baby but doesn’t get maternity leave — and in trying to obtain it for her, her well-meaning manager Glenn is fired. Cloud 9’s employees, in solidarity, go on strike. Combining birth labor with a labor movement is savvy and smart — and the type of topical, balanced humor “Superstore” is so deft with. But above all, it’s wonderful for just how daring and bold it is, plunging into a thorny topic without a single glance backwards.

11. “Silicon Valley,” “Two in the Box” (HBO): In the midst of a stellar season, “Silicon Valley” gave us one of its most incredible parables on modern capitalism yet — two horses mating in a stable while Stephen Tobolowsky explains patiently to Thomas Middleditch that the only value his precious company has is not their product or their labor, but their trade-able and fungible stock. And this is not even the only brilliant moment in this episode — which literally also features Pied Piper turning around to start selling a metal box.

10. “High Maintenance,” “Grandpa” (HBO): An entire episode told through the perspective of a dog sounds a lot more hackneyed than what “Grandpa” turns out to be — where through camera perspective and the reintroduction of a few characters, a dog’s move to New York City and his struggle to find himself becomes a short film about seeking connection, even just at hip-height.

9.  “The Crown,” “Smoke and Mirrors” (Netflix): In this episode where Elizabeth is finally crowned queen, after serving as the ruler for a long 16-month waiting period, her relationship to the pomp and circumstance of coronation comes into conflict with that of her husband Philip and — rather surprisingly — her uncle David, who abdicated before he could be crowned. Is it just smoke and mirrors, or a ritual ordained by God? And can the price of wearing the crown be compared to the difficulty of swearing fealty to it — or the strange weight of choosing to give it up?

8. “Rectify,” “All I’m Sayin’” (Sundance): The series finale of “Rectify” is the kind of achingly beautiful episode that has you quietly on the verge of tears the entire time you’re watching it. The episode offers Daniel and the rest of his family a piece of state-sanctioned validation and consolation, after 20 years of shame and guilt — and although it is not exactly a surprising revelation, it is a well-earned, finally peaceful closing moment for them, as they move out of the worst period of their lives. There is nothing here that isn’t bittersweet — but “Rectify” makes the audience feel how beautiful and holy the bittersweet is.

7. “Transparent,” “If I Were a Bell” (Amazon Studios): This season of “Transparent” lost its way when storytelling about the adult Pfefferman kids, but it found its sweet spot in “If I Were a Bell,” an episode about how Shelly and Maura Pfefferman grew up and fell in love. The period piece carries a bit of the ghostly quality of season two’s flashbacks — but also some vintage Angeleno charm, as “Transparent” takes us back to the Jewish communities of L.A. in the ‘60s.

FX’s ’80s spy drama primarily films in Brooklyn and Upper Manhattan, despite the fact that the show is set in Washington, D.C. The modern locations are often camouflaged — much like the show’s secretive protagonists — utilizing a canny mix of production design and props, with period-specific cars and set decoration helping to sell the façade.

6. “The Americans,” “The Magic of David Copperfield V: The Statue of Liberty Disappears” (FX): In some ways, all of “The Americans” so far has been building to this taut, gutting episode — in which seeds planted as far back as the premiere are finally reaped to their terrible ends, as the show begins to work towards ending its storyline in 2017. Chiefly, Martha — her life undone entirely — flees to exile in Russia, and in the resulting crucible of guilt, Elizabeth and Philip have an argument that encompasses fault lines that run the course of their relationship. And in its quieter moments, the episode pivots on teenager Paige, who is reluctantly learning how to compartmentalize her emotions and begins reporting on her pastor to her parents.

5. “Unbreakable Kimmy Schmidt,” “Kimmy Goes to a Play!” (Netflix): This is one of the most thumb-nosing, contrarian episodes to air this season — but due to the essential sweetness of “Unbreakable Kimmy Schmidt,” “Kimmy Goes to a Play!” is criticism lobbed with a lot of heart. This episode is one of television’s most astute and honest discussions on the importance and unavoidable pitfalls of identity politics — a thorny piece of work that challenges the assumptions of virtually anyone who watches it. It is hard to not be rubbed the wrong way by it — but that is part of why it is so appealing, too; it asks to be examined, as it asks its characters to attempt to communicate with each other.

4. “The People v. O.J. Simpson: American Crime Story,” “Marcia, Marcia, Marcia” (FX): The episode that won Sarah Paulson her Emmy brings a two-decades-later reckoning to the media frenzy around the O.J. Simpson trial; it offers Marcia Clark, beleaguered and maligned prosecutor, an inner life. Paulson, who felt so much for the character she cried behind-the-scenes and couldn’t watch the episodes, throws herself heart and soul into Clark, giving her the tenacity and vulnerability that the news cameras at the time never caught even as she makes every “mistake” Clark did with her demeanor and appearance. It’s a portrait and a history lesson, a performance masterclass and a delicious, amused look back at ‘90s style; it’s the show at its best.

3. “Atlanta,” “B.A.N.” (FX): The only problem with this episode is that it isn’t longer. “B.A.N.” gives us a glimpse of a fictional black entertainment network, complete with commercials and nonsensically bizarre programming. It’s an excellent example of what “Atlanta” is so brilliant at — offering a type of comedy that is not just a joke, but a situational ripple of uncontrollable laughter that keeps cresting as the episode continues.

2. “Black Mirror,” “San Junipero” (Netflix): It’s difficult to imagine how differently viewers would have viewed this season of “Black Mirror” without this hauntingly beautiful installment, which offers a love story that is — for once — gently encouraged by technology, instead of brutally devastated by it. Mackenzie Davis and Gugu Mbatha-Raw anchor it with wonderful chemistry and such human, fragile performances.

1. “BoJack Horseman,” “Fish out of Water” (Netflix): In a stroke of genius that fits a show prone to surreal, sharp fantasy, “BoJack Horseman” set an entire episode underwater — with the burbling, unintelligible dialogue to match. The effect is a silent film scored by an experimental and evocative musician, with our bumbling protagonist caught in a foreign land with unfathomable rules. It’s beautiful and funny and so, so terribly sad; a standalone tour de force.