Behind the wheel of her car, a friend of mine turns into an entirely different person. While driving, she shouts expletives and flips fingers at anyone she deems deserving. In person, however, she’s the type who apologizes profusely for bumping into strangers and, even when she’s extremely upset, will only softly mumble “frick it” under her breath. Sometimes it’s hard to believe this is the same person, but she’s not alone. Road rage is common, partly because our cars grant us a degree of anonymity, which can turn us into jerks.

The same is true for arguing online. Researchers call it the online disinhibition effect. “We are social people, but online, we don’t have the cues to recognize and really empathize with other people, how they feel or how they’re reacting to things,” said Mike Ribble, the co-author of “The Digital Citizenship Handbook for School Leaders.” We envision the internet troll, a person who posts inflammatory, antagonizing content online, as a monster hiding behind the safety of the online world. In reality, trolls can be friends, neighbors, parents — even ourselves. Even if you don’t fit the definition of a troll, which is associated with a deliberate attempt to cause discord, it’s easy to find yourself wading in the murky waters of trolldom. In other words, we all have the capacity to engage in unproductive, meanspirited arguments online that don’t reflect our character in person.

“We participate in online discussions every day and also observe toxic behavior,” said Jure Leskovec, an associate professor of computer science at Stanford University who studies online trolling. “We wanted to understand it better and provide strategies to help make online discussion forums less toxic and more welcoming.”

Dr. Leskovec and his colleagues studied trolling behavior by simulating an online discussion with subjects. They found two main factors that drive bad behavior online: negative moods and discussion context.