All species of crabs reproduce by laying eggs, but the females and males still need to mate to fertilize the eggs. During mating, the male crab carries the female on his back for up to two weeks, after which the female stores the male's sperm in sacs on her abdomen.
Female crabs can only mate after they molt, or shed their shell. When a female is about to molt, she releases pheromones that attract male crabs who then fight over the female. When the female chooses a male, she then attaches herself to the male and rides on his back until she finally molts. After the molting, she then accepts the sperm from the male, but she continues to ride on his back until her new shell has fully hardened.
Once the female detaches herself from the male, she then migrates to a different area and eventually allows the sperm to flow over her eggs to fertilize them. The eggs are then stored on a sponge-like structure on the female's abdomen for a period of several weeks until the crab larvae finally hatch. Most species of crabs can carry as many as 100,000 to 200,000 eggs at one time, but many of these won't hatch and only a small percentage ever grow to adulthood.
Many species of crab only mate once, but after fertilizing the initial set of eggs, the female continues to store enough sperm on her abdomen to fertilize two or three more sets of eggs.