Being able to tell male Drosophila apart from female Drosophila is about the most basic requirement for Drosophila genetics. There’s nothing dumber than trying to mate two females together, or more frustrating than putting a male in with a vial full of virgins (for you that is, I’m sure the male would disagree).
So, here are three ways to tell them apart.
The Bad Way

Male (left) and Female (right) wild-type Drosophila (OregonR).
The above picture shows a clear difference in size between the male and female flies, but the place to look here is the lower abdomen – the tergites here are black on the male and not in the female. This is simple, but in practice it is not a good way to tell them apart. The different body shapes and colours between stocks and individuals can vary significantly, and the distinction is rarely as clear as above. Often, inexperienced people use this as the way to tell them apart, but if you do, you will at some point get stuck, and are very likely to make a mistake.
The Right Way (aka, The Esoteric Git’s Method)

Sex combs on a male fly.
Male Drosophila have a patch of bristles (the black bits above) on their forelegs, used during courtship, that females do not. If it has sex combs, it’s a male. This method is probably the most accurate, but rarely used to sex drosophila in practice. It would take far too long to look at the forelegs of every fly you need, when it is possible to sex the fly from a distance (especially since you have to know what you’re looking for to even be able to notice the sex combs).
The Best Way
Ideally, you need to be able to sex flies accurately, but quickly. The best method is to simply look at their genitals.

Drosophila genitals, front view. (Male left, female, right).
These rarely differ in appearance between individuals, and can be seen from a distance and from various angles.

Drosophila genitals, side view. (Male left, female, right).
In practice, someone experienced in sexing flies will use a combination of these three methods. With a little practice, it is easy to become proficient at separating males from females, no matter what phenotypes the flies may have.
Things to remember
Depending on the genotype, age, conditions and other factors, individuals can vary significantly. If in doubt, try verifying using the sex combs, but if you can’t, just don’t use the fly.
If it has has an egg sticking out of it… it’s a female.
Males are not always smaller than females (especially if you are dealing with tubby mutants – often found on TM balancers).
Hermaphrodites can occur, but they’re very rare. I might have a picture of one I found somwhere…
Read More…