
The handkerchief code (also known as the hanky/hankie code, the bandana/bandanna code, and flagging)
is a system of
color-coded cloth
handkerchief or
bandanas for non-verbally communicating one's interests in sexual activities and
fetishes. The color of the handkerchief identifies a particular activity, and the pocket it is worn in (left or right) identifies the wearer's preferred role in that activity. Wearing a handkerchief on the left side of the body typically indicates one is a "top" (considered ''active'' in the act/fetish indicated by the color of the handkerchief) while wearing it on the right side of the body would indicate one is a "bottom" (considered ''passive'' in it). For example, a dark blue handkerchief indicates an interest in
anal sex
Anal sex or anal intercourse principally means the insertion and pelvic thrusting, thrusting of the Erection, erect human penis, penis into a person's Human anus, anus, or anus and rectum, for sexual pleasure.Sepages 270–271for anal sex inform ...
, and wearing it in the left pocket indicates a preference for being the penetrating partner. The code was first used in the 1970s in the
United States
The United States of America (USA), also known as the United States (U.S.) or America, is a country primarily located in North America. It is a federal republic of 50 U.S. state, states and a federal capital district, Washington, D.C. The 48 ...
,
Canada
Canada is a country in North America. Its Provinces and territories of Canada, ten provinces and three territories extend from the Atlantic Ocean to the Pacific Ocean and northward into the Arctic Ocean, making it the world's List of coun ...
,
Australia
Australia, officially the Commonwealth of Australia, is a country comprising mainland Australia, the mainland of the Australia (continent), Australian continent, the island of Tasmania and list of islands of Australia, numerous smaller isl ...
, and
Europe
Europe is a continent located entirely in the Northern Hemisphere and mostly in the Eastern Hemisphere. It is bordered by the Arctic Ocean to the north, the Atlantic Ocean to the west, the Mediterranean Sea to the south, and Asia to the east ...
, by gay and bisexual men seeking
casual sex
Casual sex is sexual activity that takes place outside a romantic relationship and implies an absence of commitment, emotional attachment, or familiarity between sexual partners. Examples are sexual activity while casually dating, one-nig ...
or
BDSM
BDSM is a variety of often Eroticism, erotic practices or Sexual roleplay, roleplaying involving Bondage (BDSM), bondage, Discipline (BDSM), discipline, dominance and submission, sadomasochism, and other related interpersonal dynamics. Given ...
practitioners. Over time the colors and types of apparel in use have greatly proliferated.
Origin

The wearing of colored bandanas around the neck as a practical accessory was common in the mid- and late-nineteenth century among
cowboy
A cowboy is an animal herder who tends cattle on ranches in North America, traditionally on horseback, and often performs a multitude of other ranch-related tasks. The historic American cowboy of the late 19th century arose from the ''vaquero'' ...
s,
steam railroad engineers, and
miner
A miner is a person who extracts ore, coal, chalk, clay, or other minerals from the earth through mining. There are two senses in which the term is used. In its narrowest sense, a miner is someone who works at the rock face (mining), face; cutt ...
s in the
Western United States
The Western United States (also called the American West, the Western States, the Far West, the Western territories, and the West) is List of regions of the United States, census regions United States Census Bureau.
As American settlement i ...
. It is thought that the wearing of bandanas by
gay men
Gay men are male homosexuals. Some bisexual men, bisexual and homoromantic men may dually identify as ''gay'' and a number of gay men also identify as ''queer''. Historic terminology for gay men has included ''Sexual inversion (sexology), in ...
originated in
San Francisco
San Francisco, officially the City and County of San Francisco, is a commercial, Financial District, San Francisco, financial, and Culture of San Francisco, cultural center of Northern California. With a population of 827,526 residents as of ...
after the
Gold Rush
A gold rush or gold fever is a discovery of gold—sometimes accompanied by other precious metals and rare-earth minerals—that brings an onrush of miners seeking their fortune. Major gold rushes took place in the 19th century in Australia, ...
, when, because of a shortage of women, men dancing with each other in
square dance
A square dance is a dance for four couples, or eight dancers in total, arranged in a square, with one couple on each side, facing the middle of the square. Square dances are part of a broad spectrum of dances known by various names: country dan ...
s developed a code wherein the man wearing the blue bandana took the male part in the square dance, and the man wearing the red bandana took the female part (these bandanas were usually worn around the arm or hanging from the belt or in the back pocket of one's
jeans
Jeans are a type of trousers made from denim or dungaree cloth. Often the term "jeans" refers to a particular style of trousers, called "blue jeans", with the addition of copper pocket rivets added by Jacob W. Davis in 1871 and patented by ...
).
In the 1970s, the modern hanky code developed as a
semiotic
Semiotics ( ) is the systematic study of semiosis, sign processes and the communication of Meaning (semiotics), meaning. In semiotics, a Sign (semiotics), sign is defined as anything that communicates intentional and unintentional meaning or feel ...
system of sexual advertising popular among the gay
leather community of the United States and
cruising scene more broadly. Businesses across the country used the hanky code in advertisements to gay clientele.
The origin of the modern hanky code is disputed. The modern hanky code is often reported to have started in
New York City
New York, often called New York City (NYC), is the most populous city in the United States, located at the southern tip of New York State on one of the world's largest natural harbors. The city comprises five boroughs, each coextensive w ...
around 1970, when a journalist for the ''
Village Voice'' jested that instead of simply wearing a set of keys on one side or the other (then a common code to indicate whether someone was a "top" or a "bottom"), it would be more efficient to subtly announce their particular sexual focus by wearing different colored handkerchiefs. However, other sources attribute the expansion of the original red–blue system into today's code to marketing efforts around 1971 by The Trading Post, a San Francisco
department store
A department store is a retail establishment offering a wide range of consumer goods in different areas of the store under one roof, each area ("department") specializing in a product category. In modern major cities, the department store mad ...
for erotic merchandise, promoting handkerchiefs by printing cards listing the meanings of various colors.
Meanwhile,
Alan Selby, founder of Mr. S Leather in San Francisco, claimed that he created the first hanky code with his business partners at Leather 'n' Things in 1972, when their bandana supplier inadvertently doubled their order and the expanded code would help them sell the extra colors they had received.
Around 1980, ''Bob Damron's Address Book'' published a yearly chart for the meaning of each colored handkerchief.
Examples
There is no single authoritative standard for the code, but there is broad agreement on the definition of certain colors. This table is drawn from
Larry Townsend's ''The Leatherman's Handbook II'' (the 1983 second edition; the 1972 first edition did not include this list) and is generally considered authoritative. Implicit in this list is the concept of left/right polarity, left as usual indicating the top, dominant, or active partner; right the bottom, submissive, or passive partner. Townsend noted that discussion with a prospective partner is still important because people may wear a given color "only because the idea of the hankie turns them on" or "may not even know what it means".
Longer, more elaborate lists may be found online, but many of the color variations in them are less often used in practice.
Present day
The hanky code has recently undergone a revival and while the use of handkerchiefs may not be as prevalent, the hanky colors are a common consideration in the choice of leather and
fetish gear color.

According to the
Schwules Museum, the creation of the
leather pride flag in 1989 marked "a turning point in the history of the mostly gay leather and BDSM movements: moving away from secret signs and symbols (hanky cloths, for example) to more obvious and public visibility, both in the gay scene and society in general."
Social media may have lessened the use of hankies in cruising areas by digitizing the process. By using online platforms,
men who have sex with men
Men who have sex with men (MSM) are men who engage in sexual activity with other men, regardless of their sexual orientation or sexual identity. The term was created by epidemiologists in the 1990s, to better study and communicate the spre ...
(MSM) can eliminate harassment and violence that they may face in public.
Social networking services for MSM allow them to easily identify sexual interests without the need for physical apparel.
In popular culture
* In the film ''
Cruising'' (1980), Detective Steve Burns (
Al Pacino) goes into a store and has the handkerchief code explained to him by a hanky salesman (
Powers Boothe).
* In the
pornographic fisting film ''Erotic Hands'' (1980) by
Bijou Video, a red handkerchief fills the screen for the opening credits.
* In the early 1980s,
Judas Priest
Judas Priest are an English heavy metal band formed in Birmingham in 1969. They have sold over 50 million albums and are frequently ranked as one of the greatest metal bands of all time. Judas Priest have also been referred to as one of the p ...
frontman
Rob Halford made the handkerchief code part of his stage costume. In the music video for "
Heading Out to the Highway", Halford can be seen wearing a red handkerchief in his left pocket.
* The hanky code is depicted and explained in the music video for "
House of Air" (2017) by
Brendan Maclean.
See also
*
Homosocialization
*
Urban legend of sex bracelets
*
Queer manicure
References
Further reading
*
{{Authority control
BDSM terminology
Color codes
Encodings
Leather subculture
LGBTQ symbols
LGBTQ terminology
Gay history
LGBTQ fashion
Fisting subculture