Research suggests that those with a variant of a certain gene are significantly more likely to give their money away.
To study the phenomenon, a game was created called The Dictator in which more than 200 online participants were each given £6.
The players could either keep it or give it to other players who remained anonymous.
They were not told to what use the money would be put in case it influenced their decisions.
After taking samples of the players' DNA code, it was found that those with a certain variation of a gene called AVPR1a were 50 per cent more likely to give the money away.
Dr Ariel Knafo, who led the research at the Hebrew University in Jerusalem said: 'This is the first evidence, to my knowledge, for a relationship between DNA and altruism or generosity.
'This is a really exciting discovery. You often hear it said that people are generous by nature.
'Well, we now know that's because it is encoded into their genes. We don't know yet why some people have this gene variation or how many people have it.'
AVPR1a affects generosity by allowing a hormone called arginine vasopressin to affect brain cells. More generous people have a longer section of the gene, called its promoter, which makes it more active.
In addition, those found to have the longer version of the gene were found to score higher in a psychological test of generosity and were more likely to believe in values such as world peace and social justice.
The study is published in the journal Genes, Brain and Behaviour. A lecturer in psychology at Buckinghamshire University, Dr George Fieldman, said there was good evidence that generosity could be inherited.