The balancing act plays out every day in restaurants across America: Servers who rely on tips decide where to draw the line when a customer goes too far.

They ignore comments about their bodies, laugh off proposals for dates and deflect behavior that makes them uncomfortable or angry — all in pursuit of the $2 or $20 tip that will help buy groceries or pay the rent.

There was the young server at a burger joint in Georgia, Emmallie Heard, whose customer held her tip money in his hand and said, “So you gonna give me your number?” She wrote it down, but changed one of the digits.

There was the waitress in Portland, Ore., Whitney Edmunds, who swallowed her anger when a man patted his lap and beckoned her to sit, saying, “I’m a great tipper.”

And at a steakhouse in Gonzales, La., Jaime Brittain stammered and walked away when a group of men offered a $30 tip if she’d answer a question about her pubic hair. She returned and provided a “snappy answer” that earned her the tip, but acknowledges having mixed feelings about the episode.

“Literally every time it happens, I will have this inner monologue with myself: ‘Is this worth saying something, or is it not?’” said Ashley Maina-Lowe, a longtime server and bartender in Tucson. “Most of the time I say, ‘No, it’s not worth it.’”

In the restaurant industry, the cultural reckoning over sexual harassment has felled celebrity chefs like Mario Batali and spotlighted pervasive misbehavior by managers and co-workers. But servers and bartenders also face abuse from another front: the millions of Americans who dine out every year and who, because of the custom of tipping, wield outsize influence over one of the largest groups of workers in the country — three million strong, according to federal data.

Their workplaces are casual environments where alcohol lightens the mood and erodes boundaries. A “customer is always right” ethos often tilts the equation — creating the kind of power imbalance that has become front and center in a broader conversation about sex and gender in the workplace.

In interviews, more than 60 servers and bartenders — nervous teenagers and seasoned veterans, students and single mothers, a few men but mostly women — shared stories of crude comments, propositions, groping and even stalking from customers. They work in diners, chain restaurants and high-end dining establishments, and they reported hourly take home pay ranging from $8 to more than $40.

A number of efforts have arisen in the last several years to protect servers from harassment. Some restaurants have adopted no-tipping policies, eliminating the leverage of a gratuity. In Oakland, Calif., a restaurant called Homeroom devised a color-coded system to monitor customer behavior: a yellow flag if a server senses a potential problem, an orange one for inappropriate comments and a red flag for overtly sexual comments or touching, at which point the customer is asked to leave.

Workers’ advocates are pushing about a dozen states and the District of Columbia to change laws that allow restaurants to pay servers less than the minimum wage, making them more dependent on tips. New York recently cited harassment as one of the reasons it was looking into the way tipped workers are paid.

Working for tips means that each shift comes with questions that do not apply to millions of other workers around the country: How much money will I make, and how much will I tolerate to make it?

“When I first started, I used to get so creeped out and weirded out all the time,” said Brittany Gilbert, a server in Charleston, W.Va., who has struggled to afford housing. “If you want to make the money, you’ll learn to laugh.”

Uncertain of Workplace Rights

The music was loud and the lights glowed red at Asia de Cuba, a clubby restaurant in New York with other locations overseas. On the second floor, Dana Angelo buzzed around the cocktail lounge in her uniform, a silky black dress that stopped midthigh with slits reaching higher. Her section was full, promising a good night.

As she paused at a table, a customer who was walking past reached under her skirt and grabbed her crotch, then continued on his way.

She stifled the urge to scream. “I don’t want to do anything that makes these people leave and not tip me,” she said. “I’m looking at $200 in tips.”

Fighting back tears, she pointed out the offending customer to her manager, expecting the restaurant to take action. Instead, she saw the manager shaking the man’s hand.

“It was the second layer of hurt,” Ms. Angelo said. She has since moved to Los Angeles, and that location has closed.

With guidance from her union delegate she was able to inform upper management of the incident, which occurred several years ago; she said the general manager apologized and told her that what happened was unacceptable.

But most servers and bartenders are not organized, and many restaurants do not have human resources departments. Servers also said they were reluctant to report anything but the most egregious behavior from customers; dealing with it simply comes with the job, they felt.

While legal action almost always targets misbehavior by managers or co-workers, courts have also ruled that employers can be liable for not protecting workers from abusive customers.

“The employer has an obligation to make a safe workplace, and if you complain, they should do something about it,” said Joseph M. Sellers, a lawyer in Washington, D.C., with years of experience in sexual harassment cases.

Managers can protect workers by switching a waitress’s table or asking an offending customer to leave.

But even for bosses with good intentions, misbehavior is difficult to police. Kaycee Lowe Wallace, who owned the Trolley restaurant in Hugo, Okla., did not know that a regular customer was groping one of her servers until she got a concerned call from the young woman’s grandmother.

Ms. Wallace questioned the waitress, Klaycey Oakes, who told her that the man had grabbed her thigh and even followed her to the bathroom. “I was like ‘Why would you have not told me?’” Ms. Wallace recalled. “She was like, ‘Well, he leaves me $20 every time.’”

Ms. Oakes, 19, said the man was elderly and she hadn’t wanted to cause a fuss. As it is for so many women, waitressing was her first job. Seventy percent of servers are women, according to the Bureau of Labor Statistics, and nearly half are younger than 25.

“Their lives and experience of work is shaped by that initial experience,” said Saru Jayaraman, the president of Restaurant Opportunities Centers United, an advocacy group for restaurant workers. “I’ve had Hollywood actresses, senators, IBM executives, lawyers tell me, ‘I have been sexually harassed later in my career, but I didn’t do anything about it because it was never as bad as it was when I was a young woman working in restaurants.’”

The indignities pile up, shift after shift. A server in San Diego, Angela Hoover, said she was standing at a table when a man came by, shoved his hand down her sweater and grabbed her breast.

“I just kind of stood there shocked,” she said. “I felt something — I was like, ‘What the heck was in my bra?’ — and it was a dollar.”

New technology has brought new affronts; servers told of young men taking photos of them as they bent over the table, and posting the photos to Snapchat with tag lines like “I can see down her shirt.”

With tips in the balance, though, workers decide how much to play along. Some swear that red lipstick means better tips. Some don a favorite shirt that shows just enough cleavage.

Danny Meyer, whose Union Square Hospitality Group owns numerous restaurants, recalled how trade magazines in the 1980s and 1990s advised women to increase tips by opening blouse buttons and placing a hand on the shoulder of male customers.

“That’s a dynamic that’s been going on forever,” he said in an interview.

Many servers acknowledged that they enjoyed a bit of cheerful flirting. Some welcomed compliments about their appearance; others hated them. Many said they drew the line at touching. And while servers and customers occasionally dated, and even married, requests for dates, phone numbers and other propositions were usually unwelcome, they said.

Some of the most threatening situations occur when customers pursue employees outside work. Several women told of men who had waited for them in the parking lot or approached them as they took out the trash.

Ms. Maina-Lowe, the server and bartender in Tucson, was terrified when a man came in as she was closing up by herself one night. He asked if she was alone and told her that he had been watching her through the window. She ran out the back door and called the police.

“I’m not generally a huge gun advocate, but I went and got one,” she said. “And every time I went to close the bar, it was in my purse.”

Despite her bad experience, Ms. Maina-Lowe said working in restaurants was still her best option. At her current job, she can earn $30 an hour in tips on a good night — nearly three times the state’s minimum wage.

The Freedom to Say, ‘Enough’

The perceived link between tipping and good service is seared into American culture, and servers in the United States rely more on gratuities than they do in perhaps any other country.

But good service does not motivate tipping decisions as much as people think, said Michael Lynn, a professor of consumer behavior and marketing at Cornell, who has spent years studying why we tip.

“The evidence just isn’t there that the desire to reward good service is driving most tipping decisions,” he said.

Instead, Professor Lynn said, customers are more likely to tip waitresses who are large-breasted, slender and blond, according to research he published in 2009. White servers are tipped more than people of color, according to his research.

Little academic research exists on the relationship between tipping and sexual harassment; groups on both sides of the debate have published studies that bolster their positions.

The National Restaurant Association, the industry’s trade group, declined to answer questions about sexual harassment of servers and the role that tips might play in it. It said in a statement: “We condemn sexual harassment. Period. It does not matter if the harasser is a customer, a colleague or a manager.”

Some labor rights advocates, convinced that tipping contributes to harassment, argue for eliminating the lower minimum wage that most restaurants pay workers who earn tips, which the federal government sets at $2.13 per hour. If you increase their base pay, the thinking goes, servers will be less dependent on tips, freeing them to push back against harassment.

Ms. Jayaraman’s group has lobbied states to change laws and require restaurants to pay the full minimum wage, a practice already adopted by seven states.

But servers themselves are divided on the issue. Many worry that the move would prompt customers to tip less while raising costs that would force restaurants to close.

“The tip credit allows employers to keep their labor costs low and allows us to make a great living,” said Joshua Chaisson, a server in Portland, Me., who helped create Restaurant Workers of America, a group that fights to preserve the tipped wage.

Restaurant owners cite thin margins that already barely allow them to make a profit.

“If I paid all my servers $7 an hour, I couldn’t charge $7 for a hamburger,” said Ms. Wallace, the restaurant owner in Oklahoma. Her experience shows how tight the finances can be; her restaurant closed in January because she could not afford to fix the heating system.

The federal minimum wage for tipped workers has not risen since 1991 when it went up four cents. Many states have taken matters into their own hands and created either their own minimum for tipped workers or required that employers pay them the full state minimum wage. $7.25 $7 an hour Federal minimum wage 6 5 4 3 $2.13 2 Federal minimum wage for tipped workers 1 0 ’70 ’80 ’90 ’00 ’10 ’17 States’ minimum wage for tipped workers $11.50 $5.00 $9.65 $4.86 $8.30* $10.25* $2.33 $8.65* $4.33 $3.35 $3.52 $4.35 $2.83 $4.15 $8.25* $4.95 $7.18 $11.00* $3.93 $2.63 $7.50 $9.84 $5.23 $9.35 State’s full min. wage Separate tipped min. wage Federal tipped min. wage ($2.13) $7.25 $7 an hour 6 Federal minimum wage 5 4 3 $2.13 2 Federal minimum wage for tipped workers 1 0 ’70 ’80 ’90 ’00 ’10 ’17 States’ minimum wages for tipped workers $5.00 $11.50 $4.86 $5.25 $8.30* $9.65 $3.26 $10.25* $3.75 $2.33 $8.65* $3.35 $4.33 $3.52 State’s full min. wage $4.35 $2.83 $4.95 $4.15 $3.63 Separate tipped min. wage $8.25* $2.62 $7.18 $11.00* $3.93 Federal tipped min. wage ($2.13) $2.63 $7.50 $9.84 $5.23 $9.35 *Highest minimum of a range. | Sources: Economic Policy Institute; Department of Labor | By Karl Russell

Some restaurants are trying a radical approach: abandoning tipping altogether.

While a primary motive is reducing the pay gap between servers and kitchen staff, who typically make less, it also makes servers and managers more willing to stand up to abusive customers.

“I felt empowered as a manager, and staff feels more empowered,” said Kim DiPalo, who was the general manager of the Manhattan restaurant Gramercy Tavern, one of Mr. Meyer’s restaurants, when it ended tipping in 2016.

Instead of sending a manager to take over a troublesome table, she was more likely to ask offenders to leave, no longer needing to worry about protecting her employees’ tips.

Jenice Marshall said working at a tip-free restaurant in New York, Dirt Candy, had been liberating.

“There’s always one guy that’s going to give you those eyes, the body language, flirt with you throughout the whole meal, and usually if you dance the dance with them, you do get a higher tip,” she said. “You want to take a shower after.” For the first time, she said, she no longer feels the need to dance along.

But restaurants that are trying no-tipping policies have struggled with opposition from both servers and customers.

Erin Wade, the owner of Homeroom, the restaurant with the flag system, said she would like to end tipping, which she considers demeaning. But other owners who had done so persuaded her not to follow them.

“Customers like the power,” she said they had told her.

Her servers were against it, too. “There’s no way we could pay them nearly as much as they’re making with tips,” she said.

Makeup, and a Proposal

On a recent afternoon in Big Lake, Minn., about 45 minutes outside Minneapolis, Ashley Lewis, 30, stood at her bathroom mirror, makeup spread over the counter. Tips go down when she is not done up, she has noticed, so she leaves 20 minutes for this ritual before each bartending shift.

The state sets her base pay at the full minimum wage of $9.65, but she needs more. To make ends meet, she is living with two other adults and three children not counting her 9-year-old daughter, who divides her time between her mother and father.

While she believes that other states should pay servers the full minimum wage, she does not see it as a cure. “I don’t think it would eliminate how men treat women,” Ms. Lewis said.

At her workplace, a bar and grill that offers an incongruous but popular mix of Jamaican, Asian and American fare to guests wearing baseball caps and hunter camouflage, she makes between $50 and $250 in tips per night.

That night, she wore red lipstick and a choker necklace. When a man asked if she wanted to marry him, she declined, her face emotionless.

“I can control the food, but I can’t control every interaction with the guests,” said the restaurant’s owner, Rowan Brown. “People always surprise you.”

Ms. Lewis is grateful for the work but conflicted about the compromises it requires.

“A significant portion of my income is how men feel about me that day,” she said.