The smartphone-based system is up to 100 per cent accurate at telling the difference between benign tumours and their malignant counterparts, reports the Daily Mail.
It also takes just an hour to make the diagnosis, meaning patients don't have to spend days or weeks anxiously waiting for test results.
The US researchers said the gadget could 'transform cancer care' by also making it easier for doctors to track how well drugs are fighting the disease in a patient's body.
In initial tests, it was 88 per cent accurate in distinguishing cancerous stomach tumours from benign growths.
Refining the technique boosted accuracy to 100 per cent, say researchers.
This compares with an average accurate of 84 per cent for the gold standard technique, which involves using chemicals that stain cancerous cells and show up under a microscope.
In future, the smartphone system could be adapted to spot brain, skin and ovarian cancers quickly and accurately.
The tiny amount of tissue needed - one thousandth of a millilitre could also spare patients the pain a risk of having repeatedly having pieces of their growth cut away for testing.
The device, developed at Massachusetts General Hospital in Boston, consists of a smartphone connected to a miniature MRI machine.
In tests, patients with suspected stomach cancer had tiny samples of their growths removed using a fine needle.
The researchers then added in antibodies designed to bind to proteins found in stomach tumours and tiny magnetic particles designed to latch onto the antibodies.
They then used the magnet in the hand-held MRI machine to excite the molecules in the sample, making them vibrate. The more the molecules vibrate, the more likely the sample is cancerous.
An application on a smartphone computes the results and provides doctors with a read-out. The application has been described in the journal Science Translational edicine.