John Durham, the owner, sat at a desk surrounded by piles of books. Bearded and a little shaggy, he seemed at one with his cluttered environment. An expert in his narrow field, Mr. Durham is the archetype of the bookstore obsessive. In response to a research need for a book I am working on, he drew my attention to “The Masses,” an early-20th-century radical monthly. He then pointed out a collection of lyric sheets, which featured songs with titles like “Albania, Our Beacon” and “Eternal Glory to JV Stalin.” “If you sing that one,” he said, “you have to make sure everyone knows you’re kidding.”

THE Mission may be San Francisco’s current book hub, but it isn’t the only neighborhood where you’ll find one-of-a-kind bookstores. If, for instance, you’re exploring Noe Valley, seek out Omnivore, a tiny, carefully curated shop that fulfills the food-mad city’s appetite for gastronomic literature. On Haight Street, Bound Together is a roughly 30-year-old anarchist collective, a closet of a shop crammed floor to ceiling with the heavy, serious literature of a parallel universe (among the shelves, near “Magic and Spirituality,” is one marked “Against Religion”). The Green Arcade, on Market Street at the edge of Hayes Valley, focuses on the more capitalism-friendly progressive genre of sustainability and eco-living.

Even the biggest used bookstore in the city, Green Apple, on Clement Street in the Richmond, maintains a distinctive feel thanks to staff members who know their way around the sprawling shop and around the world of books itself. “It’s not the kind of thing people could create from scratch these days,” said Pete Mulvilhill, one of the owners.

But if you don’t have weeks to investigate nooks and crannies, your next stop should probably be City Lights, in the heart of North Beach, the neighborhood associated with the Beat writers of the 1950s. City Lights is the grande dame of the city’s independent bookstores. Founded in 1953 by Lawrence Ferlinghetti, the poet and artist, as the first all-paperback bookstore in the country, it made its name when it published Allen Ginsberg’s incendiary “Howl and Other Poems” in 1956. The matchless publicity of an enduringly influential obscenity trial made “Howl” a best seller and — improbably — part of the American literary canon. In the process, it turned City Lights into a top destination for literary-minded visitors to the city.

I went down to City Lights one gloriously sunny Saturday, strolling past strip joints and seedy bars; the neighborhood that popularized topless dancing in America thankfully retains some of its midcentury flavor. The bookstore was comfortably bustling as I walked between the tall shelves of political philosophy and gender studies and made my way up a narrow staircase leading to the Poetry Room. There, next to a window open to the Pacific breeze, I found a chair with a hand-lettered sign tacked to the wall behind it: “Have a Seat + Read a Book.”

I made for the Ginsberg shelf and, bypassing the new 50th-anniversary annotated edition of “Howl,” selected the slim original, still published in the same disarmingly bland cover.

Rather than sit there, I bought the book and went across the lane (Jack Kerouac Lane, to be precise) to the Vesuvio Cafe, a bar that was once a Beat hangout. Vesuvio is a cozy space of dark wood, tiled floors and stained glass, with framed photos of the neighborhood greats — Kerouac, Ginsberg, Ferlinghetti — covering the walls. I ordered a shot and a beer, which seemed an apt Beat lunch, and went upstairs to the narrow mezzanine to read.