Males of most adult stag beetles usually have a pair of large to very large mandibles, and that is how you can differentiate a gender of the adult stag beetles. In case of larval stage, there is no obvious morphological character to tell whether it is a male or a female. Here I will discuss how you can tell by one small character you can find on a female larva.
If you see a light-yellow colored spots nearing their anus, it is a female! Males, like in the picture (on right), is missing the yellow spot. You see it on right side of the larva in the picture, but they have two, one in each side like picture below.
You can see these spots when they reach L3 stage, and is usually a lot easier in large species.