I wear my Apple EarPods, the classic kind with cords, for this purpose. A familiar gut feeling, the kind sharpened over years of simply existing as a woman in the world, told me I probably wasn’t alone. When I put the question to Twitter, asking users whether they wear their AirPods—or any headphones—in part because they want to tune out unsolicited attention from strangers, I heard from nearly 100 people, mostly women. Twitter is not a representative sample of the United States, let alone people who wear headphones, but a clear theme sounded through the responses: Wearing headphones made navigating public spaces feel safer.

Headphones act as both cue and barrier; they convey an air of unavailability that warns strangers not to bother and provide a membrane of protection when someone decides to anyway. Suspended in a state of plausible aloofness, people with headphones plugged in their ears can pretend they didn’t hear those comments and keep on walking.

“Before I started wearing headphones, catcallers who felt that they were being intentionally ignored would sometimes follow me, touch me, or say increasingly graphic things—sexual, racial, violent,” says Whitney Lee, an attorney in Washington, D.C. “When they believe that I’m only ignoring them because I can’t hear them, they tend to disengage faster.”

Even if the headphones can’t stop a bad situation, they can help their wearers cope with the encounter. On a recent morning, Anni Glissman, a marketing manager in Chicago, was wearing her Apple EarPods on the train when the car emptied out. A man entered from an adjacent car, sat down next to her, and began to masturbate. Glissman didn’t move, afraid a reaction might somehow make the situation worse.

As the train approached her stop, the man ejaculated onto the floor next to Glissman’s feet, and she rushed out of the car, focusing the whole time on the music streaming into her ears. “I really felt that the only way that I was able to get through that was because I had my music in,” Glissman told me. “He knew I couldn’t hear what he was saying, even though I could tell that he was saying something.” The headphone barrier, she said, gave her the courage to stay stony and keep her gaze steadily out the window.

The headphone force field can also help signal the inverse—that a nearby stranger doesn’t pose a threat. Zappa Johns, who works in marketing and lives in Monterey, California, wears headphones to not only ignore stray comments, but make others around him more comfortable. Johns, who is transgender, once used headphones to tune out sexual harassment from male strangers. After he transitioned a few years ago, he found the same implied barrier can also reassure strangers that he’s happy to stay in his own bubble.

“Before, I was trying to sort of fend off attention, and now I’m like, How can I look as nonthreatening as possible?” Johns says. “Men of color tend to be seen as more threatening than not, even when we’re just minding our own business. I’ll go out of my way to give people, especially women who are at the bus stop by themselves, as much space as I possibly can.”