Whether it’s for inspiration, the sense of camaraderie or just to chase the snakes away from the night before, as long as there have been bars there have been writers to sit on their stools, tread their beaten floorboards or pass out in their bathrooms.

In her new book, “Storied Bars of New York: Where Literary Luminaries Go to Drink” (Countryman Press, out June 6, $22.95) author Delia Cabe details some of the city’s most famous watering holes, some of which — like the writers who frequented them — only live on in memory.

Cabe, a Lower East Side native who now calls Boston home, offers a field guide for bibliophiles, or drinkers with a literary bent, to follow in the staggered footsteps of their favorite authors.

Drawing from the book, we picked some of our favorite writers and put together two different bar crawls — one for the cocktail drinkers, and one for the beer lovers — where you can drink like Hemingway, Fitzgerald, Parker or Kerouac. Just don’t drink as much as they did ...

COCKTAIL SWILLERS:

Chumley’s

This former speakeasy, once called a “resort of the literati,” reopened in 2016 after a chimney collapse shuttered the joint for nine years. Today, its new owners call it “the pre-eminent American Writer’s Bar.” Back in the day, writers used to crowd the bar and, when their book was published, the dust jacket was tacked to the wall. F. Scott Fitzgerald and wife Zelda, Upton Sinclair, William Faulkner, J.D. Salinger — the list of regulars is nearly endless. 86 Bedford St.

Blue Bar at The Algonquin

The hotel lobby bar was the birthplace of the legendary Round Table in 1919. Dorothy Parker, Robert Benchley and New York Times drama critic Alexander Woollcott were among the founding members of the so-called “Vicious Circle” — a group that met daily to eat (sometimes), drink (a ton) and gossip. If you have too many Dorothy Parker cocktails at the bar, there are rooms upstairs. 59 W. 44th St.

21

Dashiell Hammett, Faulkner, Parker and the ever-expanding Round Table crew frequented 21 back in its speakeasy days. Later, Truman Capote would set part of “Breakfast at Tiffany’s” there. Cabe recommends checking out the bizarre collection of bric-a-brac on the ceiling while enjoying a Southside Fizz. 21 W. 52nd St.

The Monkey Bar

Nurse a Manhattan while checking out the mural and see which famous writers you can pick out at this bar, which Vanity Fair editor Graydon Carter bought in 2008. Notably, in 1983, Tennessee Williams died in his hotel room above the bar. 60 E. 54th St.

Bemelmans Bar at the Carlyle Hotel

Ludwig Bemelmans got the idea for his “Madeline” series of children’s books while at Pete’s Tavern (see the beer lovers list), but it’s what he did to the walls here that brings in the literary. In exchange for room and board at the hotel, Bemelmans covered the walls in a mural depicting Madeline and her journey through Central Park. The drinks are pricey, but huge! Enjoy your Old Fashioned and spend hours with the rabbits and ice-skating elephants. 35 E. 76th St.

BEER LOVERS:

Kettle of Fish

While a literary bar in its own right (the Kettle Book Club meets regularly), the Kettle is known for being the former site of the Lion’s Head. Until it closed in 1996, the Head was a second home for E.E. Cummings, Harlan Ellison and the writers for the Village Voice. Longtime newsman and author Pete Hamill — who detailed his struggles with booze in “A Drinking Life” — said the Head was a place where everyone was “bound together in the leveling democracy of drink.” 59 Christopher St.

White Horse Tavern

Legend has it that Welsh poet Dylan Thomas drank 18 whiskeys at the bar, said “I think that’s the record” then collapsed and died in the doorway. That’s not true — he went to a hospital the next day, fell into a coma and died several days later. But Thomas still looms large at the Horse — a mural of him leaning on the bar peers down on patrons from the back room. Norman Mailer, Jack Kerouac, Lawrence Ferlinghetti and, later, Hamill, Frank McCourt and Anais Nin all downed mugs of ale here, too. 567 Hudson St.

Pete’s Tavern

There’s a plaque at a table near the front door which marks the very booth where O. Henry wrote “The Gift of the Magi” in 1905. That may not be true, but it’s still a good reason to visit Pete’s, which has been open since 1864. Notably, Bemelmans started writing and drawing “Madeline” on the backs of the bar’s menus in 1938, and Johnny Depp met Hunter S. Thompson at the bar while prepping for “Fear and Loathing in Las Vegas.” (129 E. 18th St.

The Half King

When war correspondent and “A Perfect Storm” author Sebastian Junger wanted a place to drink that reminded him of the overseas hotel bars he’d frequent while on assignment, he couldn’t find one. So he opened this place in 2000. The bar is known for its literary events and ongoing reading series. While it sounds a bit high-brow, Cabe describes it as “a bar with grit.” 505 W. 23rd St.

P.J. Clarke’s

Many books take place in Clarke’s, including ones by the likes of Jacqueline Susann and Mary Higgins Clark. Regular Charles Jackson also set his novel “The Lost Weekend” at a bar similar to Clarke’s. But it’s the writers who drank — and drink — there who are the real storyline: Capote, Hamill, Eugene O’Neill, and Gay and Nan Talese, who still stop in now and then. 915 Third Ave.