“My husband and I have different last names and then my kids all have my husband’s last name, so I’m the only Greer,” she said. No clues emerged from her magazine subscriptions or her Amazon account, she said, though she took a close look at the sports socks she bought for her father-in-law recently.

The error stood out to Ms. Greer given that many of the ads she sees online tend to be “freaky on point.” For example, she often likes posts on Facebook related to the St. Louis Cardinals, her hometown baseball team, and the University of Alabama football team, she said, and recently saw an ad for a shirt that read, “My two passions in life are the St. Louis Cardinals and the Crimson Tide.”

“That was creepily specific to me to the point it’s disconcerting,” she said.

The razor was a harmless mistake at the opposite end of the spectrum and so entertaining that she wondered if Gillette did it on purpose in hopes of getting people to post about it on social media, she said.

Bret Dodson, a 48-year-old in Seattle who works in cancer research, posted to Facebook about receiving the package on June 27, joking that the company was “only 30 and a half years late.” He said in an interview that he had not liked or followed the brand on social media or made any online purchases that would indicate he was 18. He assumed the company had bought a faulty batch of data that skewed some of its mailings.

“I work with a bunch of young people and so I’m very frequently joking about ‘us hip young millennials,’” he said. “But I don’t think I’ve ever entered myself as a millennial online because I don’t know what I’d put as my date of birth. Maybe Gillette is really good with data mining and they know I joke about being younger than I am.”

Gillette has been under pressure in recent years as it has lost market share to online upstarts, including Dollar Shave Club, which was purchased last year by Unilever. The birthday mailings include a promotion for an on-demand service from Gillette, which allows people to reorder blades using text messages. Razors and shaving-related products account for 11 percent of Procter & Gamble’s annual sales and 15 percent of its earnings.