Handkerchief Code (Hanky Code)
Added 26 Jul 2026
A system, developed in gay leather and BDSM communities from the early 1970s, of wearing a colored handkerchief in a back pocket to signal sexual interests and preferred role without speaking. Left or right placement indicated top or bottom; the color indicated the interest.
- Prevalence
- Common
- Category
- Power, Roles & Scenarios
- Domain
- Sexual interest
- Confidence
- Low confidence
- Status
- Not a clinical topic. A documented item of LGBTQ and leather-community social history and semiotics, not a paraphilia or disorder.
- Also known as
- hanky code, handkerchief code, flagging, hankie code, bandana code
- Added
- 26 Jul 2026
Featured in
Overview
The handkerchief code, or hanky code, is a nonverbal signaling system that grew up in gay leather bars, bathhouses, and cruising grounds in the early 1970s. A colored bandana worn in a back pocket, left or right, let one man announce a sexual interest and a preferred role to strangers across a crowded room, without a word exchanged and without outing himself to anyone not already fluent in the code. It is best understood today as a piece of subcultural semiotics: a compact, deniable communication tool born of a specific era of gay bar culture, rather than a sexual practice in its own right. This article covers that history and its social function; it does not reproduce the color-to-act key itself, which is incidental to understanding what the system was and why it mattered.
Definition & scope
The code worked on two axes. Which pocket held the handkerchief, left or right, signaled a person's preferred role in an encounter, conventionally read as active/dominant on the left and passive/submissive on the right. The handkerchief's color, meanwhile, was cross-referenced against a published chart to indicate a specific interest, ranging from broad BDSM roles and bondage to narrower fetishes and acts. A deeper shade of the same color, or a pattern, could refine the meaning further. The system let two strangers, at a glance, learn far more about mutual compatibility than casual conversation would risk revealing in a public or semi-public space, at a time when being visibly gay carried real legal and social danger.
History & origins
Two competing creation stories
No single, verifiable inventor is on record, and the code's own historians disagree about where it began. One folk story, unconnected to any surviving document, traces it to Gold Rush-era San Francisco square dances, where a shortage of women meant men danced together and used a blue or red bandana to mark who was taking the "male" or "female" part. The more commonly cited account places the code's actual birth in New York City around 1970, when a Village Voice writer, joking about the existing practice of signaling top/bottom preference with keys worn on a belt loop, suggested that a colored handkerchief would do the job more subtly. Neither story can be fully confirmed, and as one retrospective on the code's history concludes, its true originator "will forever remain unremembered" (Vice, 2019).
Codification through leather commerce and print
Whatever its exact origin, the practice was quickly formalized and expanded by the businesses and publications serving the emerging gay leather scene. Around 1971 the San Francisco erotica retailer the Trading Post began promoting handkerchiefs alongside printed cards listing color meanings, and Mr. S Leather founder Alan Selby has said that he and his partners built out an expanded version of the code in 1972 after a bandana supplier mistakenly doubled an order (Handkerchief code, Wikipedia). The most influential print reference was Larry Townsend (1930–2008), whose 1972 book The Leatherman's Handbook was among the first to describe gay leather and BDSM culture for a general readership; its 1983 sequel, The Leatherman's Handbook II, carried what became a widely cited version of the color chart. By around 1980, the annually updated gay travel guide Bob Damron's Address Book was also printing a standardized key, giving traveling men a common reference from city to city.
A fixture of leather-bar culture
Through the 1970s and 1980s the code was a fixture of leather bars, bathhouses, and cruising areas in cities such as New York and San Francisco, spreading via word of mouth, bar culture, and the leather press, including Drummer magazine, which printed its own chart in 1977. It functioned alongside, and helped popularize, the broader visual vocabulary of the leather subculture that also produced practices such as bootblacking.
Decline and partial revival
The code's practical necessity faded as gay life became more visible and, later, as online personals and hookup apps let people state preferences directly in text rather than through a symbol read across a bar (Metro Weekly, 2026). It never disappeared entirely, and it has seen renewed interest at leather and fetish events and among a younger generation encountering it through nightlife and social media, sometimes under the broader label "flagging," now often used as an identity marker as much as a live solicitation (Feeld, a guide to flagging).
In practice
Using the code meant choosing a handkerchief (or, later, any bandana-sized cloth) whose color matched an interest, then wearing it visibly in a back pocket, left or right, in a bar or club where other patrons were assumed to know the chart or to ask a knowledgeable friend. Reading someone else's hanky was itself part of the social choreography of a leather bar. Because the full key covers dozens of specific interests, largely explicit ones, this article describes the system's function rather than its complete chart.
Psychology & social function
The code's appeal was practical as much as erotic: it reduced the risk and awkwardness of asking directly, let people filter potential partners quickly, and did so in a period when explicit gay solicitation could draw police attention or violence. It shares that discretion-through-symbol function with other subcultural markers of role and interest, such as collaring within Master/slave dynamics, though the hanky code is a public semaphore rather than a private relationship marker.
Prevalence & culture
The code is a documented piece of LGBTQ and BDSM cultural history rather than a measured behavior, so no prevalence figure exists. Its cultural visibility is concentrated within leather, kink, and queer-history writing and within contemporary leather events, rather than the mainstream population, and it is referenced routinely in histories of gay bar culture and of BDSM subcultures more broadly.
Safety, consent & law
The practice itself carries no inherent legal or safety concern: it is a voluntary, symbolic communication tool. Any activity a wearer signals an interest in carries whatever safety and consent considerations apply to that activity on its own terms.
Common questions
What is Handkerchief Code?
A system, developed in gay leather and BDSM communities from the early 1970s, of wearing a colored handkerchief in a back pocket to signal sexual interests and preferred role without speaking. Left or right placement indicated top or bottom; the color indicated the interest.
What else is Handkerchief Code called?
Handkerchief Code is also known as hanky code, handkerchief code, flagging, hankie code and bandana code.
How common is Handkerchief Code?
Roughly 3 in 100 adults — a common interest. It scores 43/100 on the KINKSpec popularity index (rank #193 of 458).
Is Handkerchief Code a disorder or a paraphilia?
Not a clinical topic. A documented item of LGBTQ and leather-community social history and semiotics, not a paraphilia or disorder.
What category does Handkerchief Code belong to?
Handkerchief Code is classified under Power, Roles & Scenarios, tagged leather subculture, signaling systems, cruising and gay history.
- Bootblacking36/100Acts & ActivitiesThe ritual cleaning, conditioning, and shining of boots and leather gear as an act of service, with deep roots in the gay leather subculture. Bootblacking is both a genuine craft and an erotic exchange of attention, care, and authority.36
- Master/Slave Dynamic58/100Power, Roles & ScenariosAn intensive, often ongoing form of consensual power exchange in which one adult (master or mistress) holds broad authority over another (slave) within a negotiated, ownership-styled framework. A structured, high-commitment expression of dominance and submission.58
- Collaring63/100Power, Roles & ScenariosThe consensual act of placing a collar on a submissive partner as a negotiated symbol of ownership, commitment, protection or submission within a Dominant/submissive relationship, often likened to a wedding band.63
- Leather Fetish65/100Leather fetishism · Objects & MaterialsAn erotic attraction to leather as a material: its look, smell, creak, shine, and feel when worn. It overlaps strongly with BDSM gear and is bound up with a recognised, organised leather subculture with its own bars, codes, and titles.65
- Dominance and Submission92/100Power, Roles & ScenariosA consensual erotic dynamic in which one partner takes a dominant role and the other a submissive role, exchanging power within agreed limits. It is one of the most widespread elements of BDSM and of human sexual fantasy generally.92
- Uniform Fetish60/100Uniform Fetishism · Clothing & GarmentsAn erotic interest in uniforms and the authority, role, or status they signal: military, police, medical, school, or service dress. A common clothing-and-role fetish rather than a clinical disorder.60
A plain compound of "handkerchief" and "code": a colored square of cloth (from Old French couvrechief, "to cover the head") used as a coded signal. "Hanky" is the informal, diminutive form of "handkerchief" that became the community's everyday shorthand for the system.
leather subculture · signaling systems · cruising · gay history
Prevalence is computed from the entry's cited population estimate. Rows marked ESTare indicative editorial estimates scored against a fixed anchor rubric — not measured quantities. Method & anchors: methodology.
Common · ≈ 1 in 20
- 01Handkerchief code — Wikipediadefinition of the system, the square-dance folk origin story, the c.1970 Village Voice journalist account, the Trading Post's c.1971 promotion, and Alan Selby/Mr. S Leather's 1972 expanded code
- 02The mysterious origins of the hanky code — Vicethe two competing origin stories (square dance vs. Village Voice), Larry Townsend's Leatherman's Handbook II (1983) as the widely cited chart source, and the acknowledgment that the code's true originator is unknown
- 03Larry Townsend — WikipediaTownsend's dates (1930-2008), his 1972 book The Leatherman's Handbook as an early general-readership guide to gay leather/BDSM culture, and his standing in leather-community history
- 04Leather subculture — Wikipediasituates the hanky code within the broader gay leather subculture and its bar culture, alongside practices such as bootblacking
- 05The history of the hanky code — Metro Weeklythe code's spread through leather bars and print charts (Drummer magazine, 1977), and its decline alongside the rise of online personals and hookup apps
- 06A guide to flagging — Feeldthe code's partial revival among a younger generation under the broader term 'flagging,' now used as an identity marker as well as a live signal
- 07FetLife — kink community group sizes (community-size proxy)community-size proxy for present-day interest in flagging and leather signaling systems
