Opposites attract. That’s how the cliché goes, and people really believe they are attracted to those different from them: 86 percent say they want a partner who “complements them” rather than one who “resembles them.”

There’s only one problem with this idea: It’s false. I studied 1 million matches made by the online dating website eHarmony’s algorithm, which aims to pair people who will be attracted to one another and compatible over the long term; if the people agree, they can message each other to set up a meeting in real life. eHarmony’s data on its users contains 102 traits for each person — everything from how passionate and ambitious they claim to be to how much they say they drink, smoke and earn.

The data reveals a clear pattern: People are interested in people like themselves. Women on eHarmony favor men who are similar not just in obvious ways — age, attractiveness, education, income — but also in less apparent ones, such as creativity. Even when eHarmony includes a quirky data point — like how many pictures are included in a user’s profile — women are more likely to message men similar to themselves. In fact, of the 102 traits in the data set, there was not one for which women were more likely to contact men with opposite traits.

Men were a little more open-minded. For 80 percent of traits, they were more willing to message those different from them. They still preferred mates who were similar in terms of height or attractiveness , but they cared less about these traits — and they didn’t care much at all about other things women cared about, like similarity in education level or number of photos taken. They cared less about whether their match shared their ethnicity.

Women prefer similarity in subtler ways as well: A woman shows a small but highly statistically significant preference for a man who uses similar adjectives to describe himself, with “physically fit,” “intelligent,” “creative” and “funny” having the strongest effects. Men showed no such preference.

There are some nuances here. Messaging may not be an honest reflection of attraction if the people doing the messaging fear rejection (although economists have found that such “strategic behavior” is minimal in online dating). For another thing, the matches people message depend on the options eHarmony’s algorithm gives them, and that sample is skewed toward similar people. Jonny Beber, an eHarmony scientist, explained to me that the algorithm tries to optimize immediate attraction and long-term compatibility, and that because the company believes that “opposites attract … and then attack,” this usually means pairing similar people. Since eHarmony publicizes this fact, the site may well attract online daters who are sympathetic to its philosophy.

The eHarmony data I used is incomplete: It includes no gay couples, because eHarmony does not make same-sex matches on its main site. But Beber has studied data from the company’s same-sex dating site, Compatible Partners, and said similarity predicts long-term relationship satisfaction in gay couples, just as it does in straight couples. He also noted that there were differences in what traits matter to gay people, something the online dating site OkCupid has also found: Gay men and women differ from straight people in their racial preferences, for example.

eHarmony’s data set does show us that in addition to preferring similarity across traits, women seem to know that their preferences are stronger. Before feeding their choices into its algorithm, eHarmony asks users to rate how strongly they feel about nine traits — among them age, ethnicity and religion — and women express stronger preferences for every one.

This got me wondering, how self-aware are people in general? Does what they claim they care about align with their messaging behavior? It often does. People with high incomes and high degrees of education claim that income and education matter to them more, and they display an especially large messaging preference for potential mates with high incomes and educations. Members who say religion matters more to them show stronger preferences about their match’s religion.

But for other traits people appear to be confused, or lying. People of every age claim that age matters to them about the same amount — they rate it about 4.5 on a scale where 1 is “not at all important” and 7 is “very important” — but older men show much stronger age preferences in whom they message. Everyone claims that ethnicity matters to them about the same amount (4.2), but some ethnicities show much stronger preferences. Men are more likely to message women who drink more even if they claim to want women who don’t drink at all. (This remained true even when I controlled for attractiveness, age and whether the woman messaged the man, and even when I looked only at men who rated their drinking preference as important.)

So we can break down the general idea of “birds of a feather flock together” even further, into two patterns:

The simple pattern: People who display a certain trait prefer other people who display that trait; people who don’t prefer people who don’t. The subtler pattern: Everyone prefers people with a certain trait, but people who have the trait themselves display a stronger preference for other people with that trait.

Height illustrates both these patterns. Men follow the first: Short men prefer short women, and tall men prefer tall women. Women follow the second: All women prefer taller men, but tall women display a stronger preference for tall men. For intelligence, women follow the first pattern: Those who describe themselves as intelligent prefer men who describe themselves as intelligent, and women who don’t prefer men who don’t. Men follow the second pattern: All men prefer women who describe themselves as intelligent, but men who describe themselves as intelligent display a stronger preference.

In general, widely considered positive traits, like attractiveness or physical fitness, tend to follow the second pattern: Everyone prefers hotter, fitter people, but hot, fit people show a stronger preference for people like them. If we compute “eHarmony status” — how often a user is asked out by their matches — we find it also follows this pattern: Everyone prefers high-status users, but high-status users show a stronger preference for other high-status users. (It’s possible that they don’t really feel a stronger preference, but merely feel more confident in their ability to win a fellow high-status mate.)

On the other hand, traits whose optimal value is more arguable — like whether you have children or what religion you follow — tend to follow the first pattern. Those with children preferred those with children; those without preferred those without. And people generally prefer those of their own religion.

In a final effort to find opposites who attracted on eHarmony, I decided to look for the cliché example: sugar daddies. But even here, the data failed me. Of course, in a dataset of a million couples, you’ll find some who fit the sugar daddy stereotype: a younger and more attractive woman matched with an older, wealthier man. And it is true that more attractive women are more influenced by the man’s income when deciding whether to message him: Unattractive women aren’t much affected by a man’s income, but very attractive women are much more likely to message men with higher incomes. But this is true for men as well, and it isn’t necessarily a sugar daddy phenomenon — maybe more attractive people can just afford to be pickier. The sugar daddy stereotype fails in other ways as well. Women who message significantly older men were calculated to be less attractive than those men, and I could find no evidence that they cared more about income, or less about attractiveness, than women paired with men their own age. If you’re an aspiring sugar daddy, eHarmony may not be for you.

I also looked for opposites attracting in other online dating data. I spoke to Christian Rudder, founder of OkCupid, which has a rich and idiosyncratic data set. To find potential matches, users submit and answer hundreds of questions ranging from, “In a certain light, wouldn’t nuclear war be exciting?” to, “Would you consider sleeping with someone on the first date?” He believes there are obvious questions where opposites would attract, and when I joined OkCupid to explore this (my boyfriend was displeased) I found several questions, or traits, for which it seemed like this must be true: You can’t both be on top, for example.

Perhaps the most striking confirmation of the idea that birds of a feather flock together comes from the data of 23andMe, the genetics company where I work. We make genetic discoveries by combining DNA from saliva samples with thousands of survey questions, some of which you might find on a dating site — “Have you ever cheated on a long-term relationship partner or spouse?” — but many you wouldn’t — “Has a doctor ever diagnosed you with Parkinson’s disease?” We can use our genetic data to find men and women who have had a child together , which lets us see whether similar people tend to pair up using a very different data set. These couples have actually met (and mated, though we don’t know if they’re still together), they’re sometimes answering questions about matters of life and death, and they have much less incentive to lie.

Here, too, my 23andMe colleague Aaron Kleinman and I found that birds of a feather flock together: For 97 percent of the traits we examined, couples were positively correlated. Former smokers tended to pair with former smokers, the apologetic with the apologetic, the punctual with the punctual. It is worth noting that causality may go in both directions: Perhaps you’re attracted to your partner because he, like you, was on time for your first date; it’s also possible that he was initially incorrigibly late, but after you fell in love you trained him. (We also found some examples where opposites attracted: Morning people tended to pair with night owls, and people with a good sense of direction with those who lacked one.)

There are at least three reasons we so often message and eventually mate with the similar. Before we even meet, myriad forces guide us away from people who are different from us — work, schooling, eHarmony’s algorithm. When we are exposed to matches, we tend to pursue people who are similar. And after we start dating, we may grow to be even more alike. In the face of these forces, it’s perhaps small wonder that the dimensions along which opposites attract hide in the statistical shadows.

But even believers in algorithmic approaches to love acknowledge these shadows exist. Dan Ariely, an economist who studies online dating, compares people to wine — you may like them for reasons you can’t quantify. The scientists I spoke to at eHarmony and OkCupid agreed. As rich as their data sets are, the uncertainty of that first meeting remains.

Correction (April 10 6:35 p.m.): An earlier version of this article misidentified eHarmony’s website for same-sex dating; it is Compatible Partners, not Compatible Couples.