Nearly half of cancers diagnosed in the UK each year - over 130,000 in total - are caused by avoidable life choices including smoking, drinking and eating the wrong things, a review reveals.
Tobacco is the biggest culprit, causing 23% of cases in men and 15.6% in women, says the Cancer Research UK report.
Next comes a lack of fresh fruit and vegetables in men's diets, while for women it is being overweight.
The report is published in the British Journal of Cancer.
Its authors claim it is the most comprehensive analysis to date on the subject.
Lead author Prof Max Parkin said: "Many people believe cancer is down to fate or 'in the genes' and that it is the luck of the draw whether they get it.
"Looking at all the evidence, it's clear that around 40% of all cancers are caused by things we mostly have the power to change."
For men, the best advice appears to be: stop smoking, eat more fruit and veg and cut down on how much alcohol you drink.
For women, again, the reviews says the best advice is to stop smoking, but also watch your weight.
Prof Parkin said: "We didn't expect to find that eating fruit and vegetables would prove to be so important in protecting men against cancer. And among women we didn't expect being overweight to be more of a risk factor than alcohol."
In total, 14 lifestyle and environmental factors, such as where you live and the job you do, combine to cause 134,000 cancers in the UK each year.
About 100,000 (34%) of the cancers are linked to smoking, diet, alcohol and excess weight.
One in 25 of cancers is linked to a person's job, such as being exposed to chemicals or asbestos.
Some risk factors are well established, such as smoking's link with lung cancer.
But others are less recognised.
For example, for breast cancer, nearly a 10th of the risk comes from being overweight or obese, far outweighing the impact of whether or not the woman breastfeeds or drinks alcohol.
And for oesophageal or gullet cancer, half of the risk comes from eating too little fruit and veg, while only a fifth of the risk is from alcohol, the report shows.
For stomach cancer, a fifth of the risk comes from having too much salt in the diet, data suggests.
Some cancers, like mouth and throat cancer, are caused almost entirely by lifestyle choices.
But others, like gall bladder cancer, are largely unrelated to lifestyle.
The researchers base their calculations on predicted numbers of cases for 18 different types of cancer in 2010, using UK incidence figures for the 15-year period from 1993 to 2007.
In men, 6.1% (9,600) of cancer cases were linked to a lack of fruit and vegetables, 4.9% (7,800) to occupation, 4.6% (7,300) to alcohol, 4.1% (6,500) to overweight and obesity and 3.5% (5,500) to excessive sun exposure and sunbeds.
In women, 6.9% (10,800) were linked to overweight and obesity, 3.7% (5,800) to infections such as HPV (which causes most cases of cervical cancer), 3.6% (5,600) to excessive sun exposure and sunbeds, 3.4% (5,300) to lack of fruit and vegetables and 3.3% (5,100) to alcohol.
Dr Rachel Thompson, of the World Cancer Research Fund, said the report added to the "now overwhelmingly strong evidence that our cancer risk is affected by our lifestyles".
Dr Harpal Kumar, chief executive of Cancer Research UK, said leading a healthy lifestyle did not guarantee a person would not get cancer but the study showed "we can significantly stack the odds in our favour".
"If there are things we can do to reduce our risk of cancer we should do as much as we possibly can," he said.
Glyn Berwick, of Penny Brohn Cancer Care, which specialises in offering nutrition and exercise advice, agreed.
"We know from years of experience the positive impact that changing lifetsyles can have."
The president of the Royal College of Physicians, Sir Richard Thompson, said the findings were a wake-up call to the government to take stronger action on public health.
"The rising incidence of preventable cancers shows that the 'carrot' approach of voluntary agreements with industry is not enough to prompt healthy behaviours, and needs to be replaced by the 'stick' approach of legislative solutions," he said
The government said it was intending to begin a consultation on plain packaging by the end of this year.
Diane Abbott, Shadow Public Health Minister, said: "The government is failing on all the main public health issues.
"And the message from Labour, the Tory-led Public Health Committee, campaigners like Jamie Oliver and even some the government's own policy panels is clear: the government's approach to tackling lifestyle-related health problems is completely inadequate."
Public Health Minister Anne Milton said: "We all know that around 23,000 cases of lung cancer could be stopped each year in England if people didn't smoke.
"By making small changes we can cut our risk of serious health problems - give up smoking, watch what you drink, get more exercise and keep an eye on your weight."