How Pure Is This Cup Of Joe? Coffee, Conspiracy, And Citizen Science

Have you ever thought about coffee purity? It’s more something you’d encounter with prescription or elicit drugs, but coffee is actually a rather valuable commodity. If a seller can make the actual grounds go a bit further by stretching the brew with alternative ingredients there becomes an incentive to cheat.

If this sounds like the stuff rumors are made of, that’s because it is! Here in Ho Chi Minh City there are age-old rumors a coffee syndicate that masterfully passes off adulterated product as pure, high-grade coffee. Rumors are one thing, but the local media started picking up on these suspicions and that caught my attention. I decided to look to simple chemistry to see if I could prove or disprove the story.

What we want to investigate is whether price and coffee purity are related. If they are, then after accounting for the effect of price, we will want to know whether proximity to the market where artificial coffee flavoring is sold has an effect on coffee purity.

How Does An Average Joe Test Coffee Purity?

In an earlier post, I described in detail an inexpensive test that may be able to detect whether street coffee was significantly adulterated. Over-the-counter povidone iodine disinfectant reacts with starch to turn dark blue. This mixture turns less blue when mixed with caffeine and other compounds present in coffee, eventually turning brown-gray.

The test itself is very simple. A standard test mixture was prepared containing 1 ml of 10% povidone iodine, 200 ml water, and 5.0 grams tapioca starch. The amount of coffee (diluted 30:1) required to remove the blue color from the test mixture is used as an indication of coffee purity. A trusted coffee solution took 2.0 ml to change the color of 10 ml of test mixture. Calling it a reference solution does it too much justice, but we’ll stick with that nomenclature for lack of a better term.

The Market of Death

I had promised a trip to Kim Bien market, known locally as “The Market of Death”. The name comes from the fact wholesale chemicals are available here, most notoriously unsafe food flavoring and processing agents allegedly used by a few unscrupulous vendors. I had been here 5 years ago, and back then it was indeed a frightening place: barrels of nitric acid stacked high next to barrels of 30% hydrogen peroxide, in the beating sun, with motorbike traffic pushing through the chaos.

Ominous clouds and reputation aside, this was actually a pretty good market.

I have to say, that place has really been cleaned up. I wouldn’t be surprised if there are still some corners like that, but overall the really dangerous chemicals were off the roadways and out of sight. The worst I saw was a single barrel of glacial acetic acid on the side of the road, and some unattended bags of colorful dyes:

After some wandering and talking to a few friendly and helpful merchants, I managed to purchase some coffee flavoring to test. It was about USD $7 for 500 ml, and came from a labeled container. I checked the company website, and they seem to be a fairly normal company.

There were a few other types available as well. Overall they looked more or less like normal artificial flavoring that would be legitimately used in a number of situations. Except maybe this Fish Oil Replacer that was a bit odd.

Expiry date in 2015 is also alarming, but to be fair this container might have just been for display,

After returning home, I mixed the artificial flavor (a viscous black oily liquid) with water until it tasted roughly like (terrible) coffee. Then I diluted it 30 times with tap water and ran a titration – it did react, but not readily. It took about 10 ml to fully titrate compared to 2 ml for the reference sample that contained actual coffee. So it seems reasonable to expect that if some vendors are watering down their coffee and adding this type of flavoring agent, it won’t react as readily with our test mixture and we ought to see a measurable difference.

Finally, one last test – I made weak coffee, added a drop or two of artificial flavor, and drank it (the things I do for science…). It wasn’t great, so I added a little sugar. With that addition it tasted reasonably close to street coffee! At best this is very subjective analogous evidence, but I thought it was worth noting.

As an interesting side note, trading in fake food or medicine can be a capital offense in Vietnam until 2018, according to local news.

Coffee Runs All Over Town

Drinking coffee at spots all over town is a tough job, but I was willing to do it for science! To collect data, I plotted a route taking me through 5 districts of Ho Chi Minh City (1, 4, 5, 7 and Binh Thanh), and purchased the same order of coffee at each vendor I came across (dark coffee, no sugar and no ice). I noted the price and location in a notebook, then poured each sample into a small arbitrarily numbered container for storage. In the end, 22 samples were taken in for testing!

I diluted each sample 30:1 and slowly dripped into the test mixture while stirring. When the color changed to grey-brown, I made note of the volume added then repeated the test a second time for each sample. This last part was mainly to characterize the precision of the test itself, but it also helps compensate for my questionable equipment and methodology.

For all measurements of mass, I used a recently calibrated digital scale with accuracy and precision of 0.01 grams, and for all volume measurements I used a slightly terrible quality 50 ml or 500 ml graduated plastic flask. A white porcelain rice bowl served as my titrating vessel as it provided good contrast.

Finally, I used LibreOffice to tabulate and graph the data, and perform t-tests. T-tests are simple statistical tests used to determine the probability that a null hypothesis (H0) is correct. If it is less than 5% probable that the null hypothesis is correct given our data, we will reject the null hypothesis and consider our alternate hypothesis (HA) to be correct.

What I Anticipated Seeing

We can consider the following hypotheses:

H0: Street vendor coffee is not a significantly different purity compared to a reference brewed from freshly ground beans.

HA: Street vendor coffee is a significantly different purity compared to a reference brewed from freshly ground beans.

H0: Street vendor coffee purity is uncorrelated with price

HA: Street vendor coffee purity is positively correlated with price

H0: Street vendor coffee purity is uncorrelated with distance to the source of the artificial coffee flavoring, after correcting for price effects.

HA: Street vendor coffee purity is correlated with distance to the source of the artificial coffee flavoring, after correcting for price effects.

I should take a moment to mention that this test is experimental and the results preliminary at best. There is a lot of room for improvement. Informally, the research question we’re actually asking is “Can we really test coffee purity at all with a bag of tapioca starch and some iodine disinfectant?”.

Results and Discussion

Composite image shows levels of blue titration
Titration testing

The first thing to test is the test itself. The precision of the general test was determined to be +/- 10.85%, with a standard error of 2.71%. In other words, if you measure a sample a few times, you would expect each measurement to be about 11% different from the average of all your measurements. That’s awful as far as titrations go, but probably not so bad that we can’t get any meaningful data.

Next, the amount of street coffee required to react with the test mixture was an average of 2.58 ml with a standard error of 0.25 ml. Without going too far into the statistical methods, a t-test allows us to be better than 95% certain that the null hypothesis does not describe the data. In other words, we conclude that the street vendor coffee does not contain as much coffee as our reference coffee solution. Another way to describe this is that we’re 95% certain that it takes between 2.07 ml and 3.09 ml of diluted street coffee to complete the titration.

One reason why this result is interesting is because the street vendor coffee was universally much darker than our reference coffee solution (even more markedly so after dilution). So there’s reason to suspect that something fishy is going on. It’s not looking good for our coffee vendors, until we consider the effect size more closely.

The street vendor coffee required an average of 25% more sample to titrate our test mixture compared to our arbitrary reference. That doesn’t mean their product does not contain coffee – in fact quite the opposite. From our quick test earlier we determined it takes around 10 ml of dilute artificial coffee flavoring to titrate our test mixture. As far as the test can tell, overall their coffee is the real thing – just weaker than our sample that was 20 grams of a specific brand of pre-ground coffee with 150 ml of boiling water.

More specifically, the street vendor coffee also tested as containing significantly more coffee than the artificial flavoring and water, and the measured difference was rather large in this case, not a matter of 25%

In fact, only a single sample tested anywhere close to the artificial flavoring, at 6.6 ml. It was sourced in District 1 (downtown), and along with a couple of other samples, that led me to suspect that downtown may have the worst coffee due to the pressure of slimmer margins and higher trading volumes. While the data did imply it, there simply wasn’t enough to conclusively say anything at this point.

I wouldn’t be at all surprised to find that street vendor coffee is mixed moderately with materials on hand such as those used in Vietnamese nước sâm. This herbal tea contains corn silk, dwarf sugarcane, and other herbs and has a vaguely coffee-like taste. It would be a (very thick!) analogue to chicory coffee, and may or may not have a drop of artificial flavor added afterwards. At this stage though, it’s pure conjecture.

Moving on to our next hypothesis, that coffee purity and price are related: a long story short, there was absolutely no significant result found. I didn’t include a trendline or equation as they are meaningless.

Keep in mind that this is only street vendor coffee. If you included high-end coffee shops, you’d probably find an effect. I know a few that make very strong coffee. It was particularly difficult to run this analysis as the price of street coffee is more or less always VND 10,000 (about USD 0.45). There were not many samples at any other price.

Moving on to the effect of proximity to the ‘market of death’, we again found no effect.

This is the best x-axis title I’ve used in weeks

Interestingly, the highest variance in coffee purity appears to be a moderate distance away from the chemical market. This is caused by District 1 (downtown), where some suspect coffee samples were found.

Elsewhere, every sample tested reasonably close to our coffee reference. Again, there wasn’t enough data to make any specific conclusion that District 1 vendors adulterate coffee relative to other districts. It would remain an interesting avenue for further investigation though.

Amusingly, the ‘market of death’ seems to be a pretty good place to stop and have street coffee. I couldn’t resist the sweet delicious irony, so I immediately went. The coffee was quite good, cost only VND 5,000 (USD 0.22), and to top it off the vendors were really nice people.

I was unable to find any evidence of the alleged ‘chemical soup’ street coffee reported in the news. It was claimed to obviously contain harmful chemicals, not contain caffeine, and was presented as being prevalent. It may in fact exist, but after running this experiment I find their claim that it represents 30% of street coffee very suspect. In my personal experience, all of the street coffee I’ve ever purchased seemed (subjectively) to contain normal amounts of caffeine, so this result doesn’t surprise me terribly.


I found that the test produced usable data despite its serious limitations. It was able to differentiate samples, and this was repeatable. A precision of 11% leaves a lot of room for improvement though, and as suggested by some of our readers, without testing a known sample of caffeine or chlorogenic acid I can’t really vouch for it’s accuracy! In hindsight, I may have been able to do a basic test using ascorbic acid (vitamin C) solutions of known concentration to get some idea of accuracy.

The test found that street vendor coffee was significantly less pure than an arbitrary reference sample, but not by nearly enough to suggest anyone was selling a product that didn’t contain coffee. It’s very possible that the street coffee might be mixed with other substances and a limited amount of artificial flavoring added, but it’s more or less coffee. As a result I will continue to drink this fine beverage, and will discount the more serious rumors surrounding it.

One mistake I made was using volumetric measurements for the titration. While it’s the intuitive thing to do, the fact is that I have a good gram scale and a terrible graduated flask. I could have taken much better measurements this way, with the error introduced by differing sample densities probably being less than the error introduced by the inaccurate measurement of sub-milliliter volumes.

Also as our reader [Leithoa] kindly brought up in the comments of the previous post, I’m doing the titration backwards relative to established analyses. It would probably be easier to mix our sample with starch, and drip an iodine solution of known concentration (not povidone-iodine) in until the solution turns blue. Since the blue color is rather intense, there’s even the possibility of using a color sensor or similar for less subjective measurement.

Finally, iodometry is typically used to detect the concentration of oxidizing agents, using a known concentration of sodium thiosulphate (a reducing agent). Our test is now doubly backwards in the sense that we’re trying to detect reducing agents. If there was a way to make this test a closer analogue to established iodometry, accuracy and precision are likely to improve significantly.

38 thoughts on “How Pure Is This Cup Of Joe? Coffee, Conspiracy, And Citizen Science

  1. I’m itching to run some of those samples through a GC. Unfortunately I don’t have one and do not plan to buy or build one. How about paper chromatography? Dark-colored components can be separated by how easily they climb through wicking such as calibrated paper towel.

    1. IIRC there’s quite a bit of literature on running things like coffee/tea/wine through GC. I would worry about maintaining sample integrity on the way from the coffee shop to your lab, unless you have a portable GC. I can for sure tell a taste difference in freshly brewed coffee vs “oxidized” coffee that has sat around for some time.

    2. That was my initial thought to. You want to actually determine what is in the coffee. There’s going to be all sorts of (hopefully) trace items but actually determining what major chemistry is in each sample would be deeply insightful in determining what is actually being sold.

    1. Samples can presumably be rejected beforehand on the basis of subjective lingual and nasal chromatography. That is, a taste test. If it tastes too weak, it’s not coffee. If it tastes dreadfully horrid (like maybe coal tar or black paint) then it’s not coffee. Only coffee that tastes like coffee needs to be tested.

      1. “After a fairly shaky start to the day, Arthur’s mind was beginning to reassemble itself from the shell-shocked fragments the previous day had left him with.
        He had found a Nutri-Matic machine which had provided him with a plastic cup filled with a liquid that was almost, but not quite, entirely unlike tea.
        The way it functioned was very interesting. When the Drink button was pressed it made an instant but highly detailed examination of the subject’s taste buds, a spectroscopic analysis of the subject’s metabolism and then sent tiny experimental signals down the neural pathways to the taste centers of the subject’s brain to see what was likely to go down well. However, no one knew quite why it did this because it invariably delivered a cupful of liquid that was almost, but not quite, entirely unlike tea.”

        ― Douglas Adams

        1. Document SCP-294a (regarding incident 294-01): On August 21, 2005, Agent Joseph ██████ attempted to use Item SCP-294 to obtain coffee during his allotted break time at 9:30 AM. At the request of Agent █████ █████████ “to see what it would do”, ██████ requested “a cup of Joe” from the item. Moments after confirming the selection, Agent Joseph ██████ began to sweat profusely and complained of dizziness before collapsing. After moving the unconscious agent to the infirmary, the medical team recovered the contents of the cup dispensed by Item SCP-294: a combination of blood, tissue, and other bodily fluids. Testing revealed the DNA sequence of the biological material dispensed by SCP-294 matched that of Agent ██████.

    1. Independent if it is whale or fish oil, the application for “roasting coffee and baking” seems much more disturbing. I can’t imagine fish oil in coffee would do the taste any good.

      1. They might simply mean what type of business would buy it, rather than what stage in the process it is used. Presumably you would mix it with some sort of dry agricultural waste to create a filler with the right look and feel.

    1. 2 ml of coffee he brews turns the iodine brown
      10 ml of artificial coffee flavouring drink turns the iodine brown
      2.5ml of street coffee turns the iodine brown
      Conclusion: street coffee is a bit weaker than the coffee he makes, but is still mostly real coffee rather than flavouring
      Secondary conclusion: the best place to buy coffee is the less busy districts away from downtown, distance to the sketchy chemical market doesn’t matter
      Also secondary conclusion: the experiment could have been designed better to make better use of his accurate lab equipment and the properties of iodine as an indicator

    1. It is a rather convenient market! There are inspectors, actually. Like most things in the developing world, it’s a story of someone basically trying to do their job with limited resources. Just like the merchants themselves. The news covers examples of people being shut down for doing particularly ridiculous or dishonest things. The less serious things seem to get filed under ‘we’ll deal with it when possible’.

      I’ve been to a good market in Shanghai as well, but it’s been a while. Word of advice though — you’re not allowed to take many substances on the subway, so take a taxi. I didn’t find this out the hard way, but imagine it could be markedly inconvenient.

      Also at the time you needed a certificate of some sort to buy acetone (it was a controlled substance), so if you need to clean circuit board blanks you’ll need to use another solvent.

  2. I love this experiment. While fascinated and intrigued by the first article to the point where I wondered if you could accomplish what you set out to do using the method you did, in this article I was simply delighted by your use of materials at hand to satisfy the questions.

    HaD is full of great people doing great things that are full of great technique and great results.
    Your article demonstrates that there is a place for great people to implement great technique with mildly-satisfactory tools to settle the question well enough. In reading this article I am certain there are many including yourself who can identify better tools and better methods, more accurate outcomes, and more precise answers. In fact, in the Market of Death (nice axial nomenclature btw) you likely could have purchased everything you needed to supply an alternate method.

    After living in several countries for extended periods, I am delighted by the simple accessibility to answer a question that plagues an entire local industry. In fact, if you can forgive my pun, you may have identified a solution for the common man.

  3. Would it be possible to buy a proper buret?
    Maybe the market of death has some glassware (Barrels of nitric acid *shivers*). I’m impressed you got the results you did with just a flask.
    It might be possible to cobble something together out of vinyl tubing and a stopcock (or pipet tip & clever use of a digit over the open end) if a buret is impossible to source. or too expensive. Just measure the length of fluid used as you go and convert to volume once you’ve reached the end point.
    Would it be possible for you to convince the vendors to part with some of their ground ‘coffee’ prior to brewing? Or tell you what supplier they frequent? This way you can better control the brewing process.

    As [Ryan Turner] brought up it may be hard to differentiate watered down coffee from adulterated coffee by just going off a starch titration. Looking for other adulterants should make this easier.
    Xylose is a sugar found in roasted grain ‘coffee’ in high concentrations and you can use iodometry to detect it. but weird corn sugars aren’t really what the ‘common knowledge’ are talking about.

    Narrowing down what to look for rather than identifying what’s missing may be easier.

    1. If the coffee vendors are just watering down their coffee a bit, I’m not so worried! I was more concerned about the widespread rumor that the coffee is just water and artificial favoring.

      I didn’t explicitly test for watered down coffee prevalence, but the coffee from street vendors was very much darker than my trusted sample brewed from 20 grams of Trung Nguyen ‘S’ brand. That indicated to me that it’s not just watered down… how could it be so dark? I have an RGB color sensor (TCS34725), I could quantify this by doing some basic transmission spectroscopy. I seem to recall something about Beer’s Law, and might be able to work out some expected correlation between the titration and the spectroscopy results to indicate if it’s more consistent with watered down coffee or additives. I’ll add it to me (already long) list!

  4. I solved this issue for myself last weekend, using a very different approach. I planted 20 coffee trees to go with my camellias (tea). I like playing with chemistry, but trying to sort out what is really in street vendor brews is an epic challenge that I’ll gladly leave to others. In fact if I did want to know I’d probably dehydrate the samples, note the mass change then send the residue off to China to get looked at in a lab with all the right gear.

    1. Hey Alex!

      A good friend of mine here has a full roasting setup. I build quality control tools for him, that’s how I learned half these things.

      Drop me a line if you need some more tools. I can share schematics/code for some of them.

      1. Yeah, Sean, I thought I detected something of the QC ethos in your approach. My wife’s a QC engineer. There’s weird stuff in the QC business, including quitting in disgust over being required to fake your results, or getting fired for discovering things that were supposed to remain hidden.

        QC also takes on the agenda of improving safety. My wife quit one place that was having too many fires, and a week later they had an explosion. For her birthday I bought her a copy of Sax’s Dangerous Properties of Industrial Materials.

  5. Bit of missing context here: Local brands of coffee are sometimes roasted with a ‘secret recipe’ that often contains butter and fish sauce (may or may not be what they mean by fish oil).

    Personally, I rather like it that way but I wasn’t aware they used so much fish sauce in coffee roasting that it was economical to use artificial flavors.

  6. The whole thing is a bit meaningless. A lot of effort, but little sense. People might just sell differently roasted brands, different brewing temps, different drip times or there might be differences in Arabica/Robusta composition, which has a huge influence on chlorogenic acid content.
    Without confirming the presence of non-coffee in your samples, the results are meaningless.

  7. I work in a facility that designs coffee flavoring drinks (among other things). Yes you can make fake coffee. No it would not save money. But, you can make a tasty ice cream with it!

  8. A quick google found . From this mostly similar appearing product which is touted as being employed for confection coating, I would suppose the purpose in coffee roasting would be to impart the oily appearance that characterizes high quality beans. Likely it is odorless and tasteless and assumes a cosmetic function.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.