The test allows scientists to examine DNA shed from cancer tumour cells into the bloodstream, in particular a gene called TFP12.
The gene usually helps stop healthy skin cells growing out of control, which can potentially lead to cancer.
But in melanoma patients this gene is switched off due to the presence of chemical 'tags' - known as DNA methylation.
Experts behind the test found that higher levels of DNA methylation suggested the cancer had spread around the body.
Early stage tumours had relatively low levels of DNA methylation, while advanced cancers (those that had spread) had much higher levels, suggesting the gene was more tightly shut down.
Measuring levels of methylated TFP12 in DNA in the blood could help doctors work out whether the disease has spread and what treatments may be needed.
Dr Tim Crook, study author and a consultant medical oncologist based at the University of Dundee, said: "Once melanoma starts to spread it becomes far more difficult to treat. But actually detecting whether or not it has started to spread is also challenging.
"By using a blood test, we have the basis of a simple and accurate way of discovering how advanced the disease is, as well as an early warning sign of whether it has started to spread.
"This would give doctors and patients important information much sooner than is possible at the moment.
"There's increasing evidence that the latest treatments are more effective in these early stages and, if we can identify patients whose cancer has only just started to spread, this would significantly improve the chances of beating the disease."
The study will be presented at the National Cancer Research Institute (NCRI) Cancer Conference in Liverpool today.
The same Dundee researchers have identified another potential biomarker - NT5E.
This gene appears to become methylated and switched off as melanoma first develops. But if NT5E becomes unmethylated again, the gene is reactivated and helps the disease to spread more aggressively.
The researchers suggest that NT5E could be a possible target for the development of new treatments to tackle melanoma, particularly for aggressive cancers that have spread to the brain, lungs and other organs.
Story continues below...
Professor Charlotte Proby, a Cancer Research UK dermatologist based at the University of Dundee, said: "Using blood tests to assess the landscape of our DNA is a simple way to learn more about what's going on under the skin. The switching on and off of certain genes seems to affect when, where and why the melanoma spreads.
"Our goal is to develop a panel of similar biomarkers that will help us to accurately detect those patients needing extra treatment to fight their melanoma.
Dr Harpal Kumar, chief executive of Cancer Research UK and chair of the NCRI, said: "Thanks to research, more than eight in 10 people now survive melanoma for at least 10 years. But there's still more work to be done to improve things further, particularly for those patients whose cancer has spread to other organs.
"This work could lead to quicker diagnosis and potentially new treatments, giving patients and doctors an even better chance of beating the disease."
In 2010, 12,818 people in the UK were diagnosed with malignant melanoma.
In 2011, there were 2,209 deaths from the disease.