Of all the questions people ask me about cannabis cooking, dosing THC properly is one topic that always causes home cooks the most concern.

When I started writing about cooking with cannabis, I taught people how to estimate a reasonable THC dosage range to use in their cooking, just as cannabis cooks have been doing for thousands of years. Determining this “dosage window” involves balancing factors such as plant strength with the tolerance levels of the people consuming the food.

But instead of a reasonable dosage window with variations of 10 – 15 milligrams, wouldn’t it be great to know exactly how many milligrams of THC per serving your homemade edibles contain?

There’s a formula you can use to get a pretty close approximation, even when the plant matter you are using has not been lab-tested. Is this formula totally foolproof? No, because THC levels can vary widely, but it will give you a pretty good idea.

However, if you are cooking with cannabis that HAS been lab-tested, you can use this formula to calculate even more precisely just how many milligrams of THC—and even CBD—per serving your homemade edibles contain.

I’m going to explain the formula here, but don’t worry about doing the math because there’s a handy Marijuana Dosage Calculator tool that does all the work for you. You get access when you sign up for my free 10 minute online dosing class that will teach you how to use it anytime you cook with marijuana.

Determine THC Percentage

For the sake of argument, let’s say that you do not know how much THC is in the plant material you are using, since most people won’t. A U.S. government study in 2009 said the national average of THC is 10 percent, but we know that not all weed is created equal.

Reportedly, the government grown cannabis from the University of Mississippi that is supplied to researchers tops out at a measly 3 percent THC, whereas a 2015 Colorado study that analyzed 600 samples from that state saw some top shelf strains containing a whopping 30 percent THC.

If you are cooking with schwag—low quality brick weed, trim or with government weed—use a THC content closer to 3 percent to start your estimate. If you know that your plant material is more potent than schwag, you might want to start your estimate with 10 percent or slightly higher.

But since Uncle Sam says average marijuana contains 10 percent THC, that’s what we will use in our example.

It’s also a nice round number that makes it easier for people who are mathematically challenged to grasp the concept.

The Formula

Here’s how to do it:

1 gram of cannabis = 1000 milligrams

10% of 1000 milligrams is 100 milligrams

This means that, assuming we are using “average” marijuana, one gram of cannabis contains 100 milligrams of THC.

Are you with me so far?

Next, let’s calculate how many milligrams are in a batch of marijuana butter.

As an example, let’s say I used one ounce (equaling 28 grams) of average quality marijuana to make one cup of butter. That would mean 2800 milligrams of THC went into that one cup of butter.

Moving on, the amount of THC in a given recipe will depend on the amount of butter used.

If I used 1/2 cup of that butter to make a batch of 36 cookies, then the entire batch would contain 1400 milligrams. Divide 1400 mg by the number of servings, in this case 36, to determine that each cookie will contain about 38.8 milligrams of THC.

To recap, first you need to estimate the percentage of THC in your plant material (or use the numbers from the lab test) and divide that into 1000 to get the per milligram amount.

Next, calculate the number of milligrams in your infusion and in the amount of infusion you will use to make your recipe. Divide that by the number of servings your recipe makes, and you will know the per serving dose.

You can use this formula to create recipes that always ensure you are delivering a THC dose that meets your needs.

If you find a given recipe delivers too strong of a dose, cut the amount of cannabutter or oil and dilute with regular butter or oil to make up the difference. Cookies not strong enough? Add more THC to your recipe with some decarboxylated kief, hash or hash oil.

I hope you grasp the dosage calculation concept. If not, don’t worry; click to the free dosing class for another example and access to the dosage calculator tool that will do all the work for you.

Cheri Sicard is the author of The Cannabis Gourmet Cookbook (2012 Z-Dog Media) and Mary Jane: The Complete Marijuana Handbook for Women (2015 Seal Press), and the creator of the internet’s first comprehensive online Marijuana Cooking Course for Home Cooks.