Close friends have eerily comparable neural responses to life experiences, a new study suggests.

"Our results suggest that friends process the world around them in exceptionally similar ways," said lead author Carolyn Parkinson, director of the Computational Social Neuroscience Lab at the University of California in Los Angeles.

Using magnetic resonance imaging (MRI) to compare which regions of the brain lit up as 42 volunteers watched short clips from news reports, music videos, comedy skits and documentaries, researchers were able to identify who among them were friends.

The closer the relationship, the more alike the neural patterns in parts of the brain governing emotional response, high-level reasoning, and the capacity to focus one's attention.

"Friends had the most similar neural activity patterns, followed by friends-of-friends," the authors said in a statement.

"You can predict who people are friends with just by looking at how their brains respond to the video clips."

The 14 brief excerpts included journalists debating whether then US president Barack Obama should use humour in his speeches; a sentimental music video about a social outcast with a facial deformity; a documentary about baby sloths in Costa Rica; and scenes from a gay wedding.

Scientists long ago understood that "birds of a feather flock together" when it comes to human social networks, with people attracted more easily to those of the same age, physical appearance and ethnic background, as well as other demographic categories.

In the digital era, this tendency extends to social networks too, according to the study, published in the journal Nature Communications.

From an Darwinian perspective, evolutionary psychologists argue, the "like-with-like" principle favour social cohesion, empathy and frictionless collective action.

The relationships we forge with individuals who are clearly different from us - not of our "tribe" - tend to be practical, task-oriented and short-lived, research has shown.

One question not answered by the study is whether we naturally gravitate towards people who see the world the same way we do, or whether similarity - including the way our brains light up - springs from shared experience.

Most likely, it is a combination of the two.

"We are a social species and live our lives connected to everybody else," said senior author Thalia Wheatley, a professor of psychology and brain science at Dartmouth University in Massachusetts.

"If we want to understand how the human brain works, then we need to understand how brains work in combination - how minds shape each other."