Tell us a few details about you and we’ll guess which political party you belong to. It shouldn’t be that simple, right? We’re all complex people with a multiplicity of identities and values. But the reality is that in America today, how you answer a handful of questions is very likely to determine how you vote.

This quiz, based on recent surveys with more than 140,000 responses, presents a series of yes-or-no questions to predict whether someone is more likely to identify as a Democrat or a Republican. It captures divisions that should make you worried about the future of American democracy.

Yes No Restart We won’t collect your answers.

The first question is the most important: It’s about race. Asking whether someone is black, Hispanic or Asian cleaves the electorate into two groups. Those who answer “yes” lean Democratic; the others are split roughly evenly between the parties. Among those who are not black, Hispanic or Asian (mostly white people), the second most important question is whether the person considers religion important. If they answer “yes,” they are probably Republican.

It’s not just race and religion, though. Party allegiances are now also tied to education, gender and age. Americans have sorted themselves more completely and rigidly than any time in recent history.

This identity-based polarization threatens to make politics “less about what the government should do and more about what it means to be an American,” write John Sides, Michael Tesler and Lynn Vavreck in their book, “Identity Crisis.” And while President Trump did not precipitate this shift, he exploits and reinforces it with racist and xenophobic rhetoric.

Racial and religious groups aren’t monolithic, and one lesson from this project is that identities can intersect in intricate and unexpected ways. But today’s charged political climate is in large part explained by how neatly demographics divide Democrats and Republicans.

How demographics predict party affiliation Two questions about race and religion divide the population into distinct categories; others about education, age and sexuality splinter them further. But with the right mix of personal details, people who are separated initially can converge near the bottom of this tree. 1 2 3 1 Most Democratic The group most likely to be Democrats are black women older than about 30. 2 Meeting in the Middle These groups were initially split by the question about religious importance. But they converged near the middle because of their education, gender and more. 3 Reliable Republicans White, religious Protestants lean Republican, but those who are male and live in the South are even more likely to identify with the party. 1 Most Democratic The group most likely to be Democrats are black women older than about 30. 2 Meeting in the Middle These groups were initially split by the question about religious importance. But they converged near the middle because of their education, gender and more. 3 Reliable Republicans White, religious Protestants lean Republican, but those who are male and live in the South are even more likely to identify with the party.

When identity aligns with party, politics gets more vicious

Sorting has occurred on both sides, but the Republican Party has tended more toward homogeneity: whiter, more Christian and more conservative. Democrats are a far more diverse party. So although the term “identity politics” is often wielded to criticize the Democrats for focusing on race and gender, Republicans are typically more susceptible to appeals based on their shared identity than Democrats, according to research by Julie Wronski and Lilliana Mason, political scientists at the University of Mississippi and the University of Maryland, College Park.

Personal identities have split the parties From 1968 to 1978, white men who attended church frequently were 6 percentage points more likely to be a Democrat than a Republican. From 2008 to 2016, they were 43 points more likely to be Republican. The party identification of young, unmarried women stayed about the same — but the average American became significantly more likely to identify as Republican, magnifying the difference between these two groups. Note: “Religious” refers to those who said they attend church every week or almost every week. Source: American National Election Studies

Polarization has encouraged more straight-ticket voting: Once, a voter might have chosen the Republican presidential candidate but a Democrat for the Senate, but now one’s whole ballot tends to align with one’s presidential preference. Polarization has also made voters hesitant to support politicians willing to cooperate with the other side, contributing to legislative gridlock.

Worse, the alignment of party preferences with personal identities has fostered ugly, tribal politics. It’s easier to demonize the opposing side when they look nothing like you. Voters today like their own party less than ever, but are motivated by their even stronger dislike of the other party. “It doesn’t paint a pretty picture,” Dr. Wronski said.

Can a religious, white Republican Party survive?

The partisan gap between black and white voters is the most durable and powerful split in modern American politics. Soon after President Lyndon Johnson signed the Civil Rights Act in 1964, he remarked, “I think we just delivered the South to the Republican Party for a long time to come.” He wasn’t wrong. Afterward, the Republicans courted racist white voters by opposing school and housing integration.

Among white people, religion is the most stable and important determinant of party choice. But the way religion shapes party attachment has changed. Today, the best way to sort the population of white voters is not by which religion they belong to, but by how religious they are.

Among white Americans: Among white Americans: Catholics have moved right Religiosity has become more divisive The race gap persists Since at least the 1960s, black Americans have overwhelmingly preferred the Democrats. White people have moved toward the Republicans. Historically, white Catholics and Jews were more likely to be Democrats than Protestants. But the gap has shrunk as Catholics have moved to the center. With the rise of Jerry Falwell’s Moral Majority and Pat Robertson’s Christian Coalition in the 1980s, white evangelicals aligned with the Republicans. +80D +40D Even +40D Even +40R +40D Even +40R 1976 1976 1984 1984 1992 1992 2000 2000 2008 2008 2016 2016 +70D +37D +17D +8R +50D +13D +13R +32R +3D +41R Only white Americans: Only white Americans: Black Hispanic Asian or other White Jewish Everyone else Catholic Protestant Everyone else Religious Among white Americans: Among white Americans: Catholics have moved right Religiosity has become more divisive The race gap persists Since at least the 1960s, black Americans have overwhelmingly preferred the Democrats. White people have moved toward the Republicans. Historically, white Catholics and Jews were more likely to be Democrats than Protestants. But the gap has shrunk as Catholics have moved to the center. With the rise of Jerry Falwell’s Moral Majority and Pat Robertson’s Christian Coalition in the 1980s, white evangelicals aligned with the Republicans. +80D +40D Even +40D Even +40R +40D Even +40R 1976 1984 1992 2000 2008 2016 +70D +37D +17D +8R +50D +13D +13R +32R +3D +41R Only white Americans: Only white Americans: Black Hispanic Asian or other White Jewish Everyone else Cath- olic Pro- testant Everyone else Religious The race gap persists Since at least the 1960s, black Americans have overwhelmingly preferred the Democrats. White people have moved toward the Republicans. +80D +40D Even 1976 1984 1992 2000 2008 2016 +70D +37D +17D +8R Black Hispanic Asian or other White Among white Americans: Catholics have moved right Historically, white Catholics and Jews were more likely to be Democrats than Protestants. But the gap has shrunk as Catholics have moved to the center. +40D Even +40R 1976 1984 1992 2000 2008 2016 Only white Amer- icans: +50D +13D +13R +32R Jewish Everyone else Catholic Protestant Among white Americans: Religiosity has become more divisive With the rise of Jerry Falwell’s Moral Majority and Pat Robertson’s Christian Coalition in the 1980s, white evangelicals aligned with the Republicans. +40D Even +40R 1976 1984 1992 2000 2008 2016 +3D +41R Only white Americans: Everyone else Religious Note: All charts show the percentage point difference in party identification, averaged every four years. “Religious” refers to those who said they attend church every week or almost every week.

The number of religious white Americans is plummeting. In the long term, that spells disaster for Republicans. “I don’t think the Republican Party right now has a sustainable business model,” said Alan Abramowitz, a political scientist at Emory University.

The party knows this. Or at least it should. After Republicans lost the 2012 election, the party leadership commissioned a report on how to move forward. One answer was clear: appeal to nonwhite and less conservative voters. But in the years since, the Republicans — led by Mr. Trump — have doubled down on white identity politics and seem to believe that their path to a majority is through gerrymandering, voter suppression or attempts to skew the census.

The relationship between education and party has flipped

College-educated white people have left the Republican Party over the past decade, but higher-income voters are, as ever, disproportionately Republican. Wealthier people tend to be more educated, too, but now these forces push in opposite directions. That complicates the traditional relationship between Democrats and the white working class.

For decades, working-class people voted for Democrats, but recently, the difference in party affiliation between the white working class and other white people has evaporated. This trend, experts say, might make it difficult for the 2020 Democratic presidential nominee to mobilize voters by appealing to working-class identity.

Among white Americans: Among white Americans: Among white Americans: College graduates have run left High-income people lean Republican The class gap has disappeared Republicans traditionally won college-educated white voters, and Democrats those with a high school degree or less. That has reversed. Higher income still predicts stronger Republican affiliation. But middle-income voters have drifted away from the Democrats. Democrats were historically the party of the working class. But in 2016, there was almost no difference between working-class and other white people. +20D Even +20R +20D Even +20R +20D Even +20R 1976 1976 1984 1984 1992 1992 2000 2000 2008 2008 2016 2016 +4D +14R +3D +14R +14R +9R +10R All charts show only white Americans: College or postgraduate High school or less Low- income Middle High Working- class Everyone else Among white Americans: Among white Americans: Among white Americans: College graduates have run left High-income people lean Republican The class gap has disappeared Republicans traditionally won college-educated white voters, and Democrats those with a high school degree or less. That has reversed. Democrats were historically the party of the working class. But in 2016, there was almost no difference between working-class and other white people. Higher income still predicts stronger Republican affiliation. But middle-income voters have drifted away from the Democrats. +20D Even +20R +20D Even +20R +20D Even +20R 1976 1984 1992 2000 2008 2016 +4D +14R +3D +14R +14R +9R +10R All charts show only white Americans: College or postgraduate High school or less Low- income Middle High Working- class Everyone else Among white Americans: College graduates have run left Republicans traditionally won college-educated white voters, and Democrats those with a high school degree or less. That has reversed. +20D Even +20R 1976 1984 1992 2000 2008 2016 +4D +14R College or postgraduate High school or less Only white Americans: Among white Americans: High-income people lean Republican Higher income still predicts stronger Republican affiliation. But middle-income voters have drifted away from the Democrats. +20D Even +20R 1976 1984 1992 2000 2008 2016 +3D +14R +14R Low- income Middle High Only white Americans: Among white Americans: The class gap has disappeared Democrats were historically the party of the working class. But in 2016, there was almost no difference between working-class and other white people. +20D Even +20R 1976 1984 1992 2000 2008 2016 +9R +10R Working- class Everyone else Only white Americans: Note: All charts show the percentage point difference in party identification, averaged every four years. College and postgraduate degrees include only bachelor’s-level degrees or higher. Income groups are approximate and refer to family income in the year of the survey or the previous year. Low-income refers to those below the 34th percentile of income, middle-income to those between the 34th and 68th percentiles, and high-income to those at or above the 68th percentile.

Some political scientists have attributed the emergent “diploma divide” to less educated white voters’ racial resentment. Dr. Sides, Dr. Tesler and Dr. Vavreck argue that during Barack Obama’s presidency, less-educated white people who may not have followed politics began to link the Democrats to progressive attitudes toward race and fled the party as a result. Even education is, in a sense, a proxy for opinions about race, the brightest line in today’s partisan conflict.

Women aren’t a voting bloc

A person’s gender is not especially good at predicting party affiliation — at least not on its own. When combined with age and marital status, though, it becomes more relevant. Seventy percent of millennial women identify with or lean toward the Democrats, according to a 2018 report from the Pew Research Center, and about 57 percent of unmarried women leaned Democratic in a 2015 Pew report.

The gender gap has fluctuated Married people are more Republican The age gap developed recently The early 2000s saw younger voters break for the Democrats, possibly because of opinions on the Iraq war. The difference between men and women peaked in the mid-1990s and shrank afterward. Single voters are increasingly important. In 1960, 72 percent of U.S. adults were married; in 2016, only half were. +30D +20D +10D +30D +20D +10D Even +20D +10D Even 1976 1976 1984 1984 1992 1992 2000 2000 2008 2008 2016 2016 +15D +2D +28D +2D +16D +4D Female Male Never married Everyone else Under 35 years old 35 and older The age gap developed recently The gender gap has fluctuated Married people are more Republican The early 2000s saw younger voters break for the Democrats, possibly because of opinions on the Iraq war. The difference between men and women peaked in the mid-1990s and shrank afterward. Single voters are increasingly important. In 1960, 72 percent of U.S. adults were married; in 2016, only half were. +30D +20D +10D +30D +20D +10D Even +20D +10D Even 1976 1984 1992 2000 2008 2016 +15D +2D +28D +2D +16D +4D Female Male Never married Everyone else Under 35 years old 35 and older The gender gap has fluctuated The difference between men and women peaked in the mid-1990s and shrank afterward. +20D +10D Even 1976 1984 1992 2000 2008 2016 +15D +2D Female Male Married people are more Republican Single voters are increasingly important. In 1960, 72 percent of U.S. adults were married; in 2016, only half were. +30D +20D +10D 1976 1984 1992 2000 2008 2016 +28D +2D Never married Everyone else The age gap developed recently The 2000s saw younger voters break for the Democrats, possibly because of opinions on the Iraq war. +30D +20D +10D Even 1976 1984 1992 2000 2008 2016 +16D +4D Under 35 years old 35 and older Note: All charts show the percentage point difference in party identification, averaged every four years.

The partisan gender gap developed in the 1980s as men drifted toward the Republican Party; it widened in the 2016 Trump versus Clinton election. Much like racial resentment explains support for Mr. Trump, researchers have found that “hostile sexism” — measured by asking questions like whether someone believes women seek to control men — is increasingly dividing the parties.

As issues like sexual assault gain prominence in the national political conversation, the combination of gender with other characteristics like age and marital status helps predict whether a voter describes himself or herself as a feminist — and that directly relates to party affiliation. Democrats are more than twice as likely as Republicans to say the country needs more work to achieve gender equality.

Partisanship can turn violent

Parties don’t just matter in elections. They affect how people identify, not just the other way around. Some people adjust their religious habits to better match their partisanship: For example, Republicans in search of other Republicans might start attending church more often. Put another way, people aren’t just sorting themselves into parties. Parties are sorting people, too, making cultural and racial rifts wider and harder to bridge.

And because partisan identities tend to be deeply held, political events rarely shake adults’ party preferences, which means the resentment from identity-based polarization probably isn’t going to spontaneously dissolve. In fact, it might get worse. Dr. Abramowitz writes in his book “The Great Alignment: Race, Party Transformation, and the Rise of Donald Trump” that polarizing forces — increased racial diversity, the waning influence of religion and the rise of partisan media — are “far from spent.”

Nathan Kalmoe, a political scientist at Louisiana State University, has examined political parties during the most divided period in American history: the Civil War. In his book “With Ballots & Bullets: Partisanship & Violence in the American Civil War,” he demonstrates how newspapers and party leaders encouraged citizens to fight by exploiting their partisan identities, fueling a war that killed 750,000 people.

Though America isn’t facing a civil war right now, he writes, “the country is in an uncomfortably similar position today,” with “racial-religious-partisan alignments, political demonization, rhetoric rejecting fair elections, and even language encouraging violence from prominent leaders, including the president.”

Americans, he says, haven’t fully appreciated the potential of party conflict — inflamed by social sorting and impetuous leadership — to devolve into “organized mass violence.” Partisanship, he says, “has extremes that we haven’t recognized.”

Sahil Chinoy is a graphics editor for The New York Times Opinion section.