To properly check the sex of a guinea pig, the owner must flip it over on its back and spread its hind legs apart to look at its rearmost quarters. Guinea pigs are not sexually dimorphic, and it is difficult to determine sex otherwise.
In addition, male guinea pigs and female guinea pigs have genitals that may appear similar due to the lack of external testicles. Both male and female guinea pig genitals look like rounded protrusions slightly forward of the anus along the surface of the belly.
The main difference in genital appearance is the distance the body part is from the anus. A male's penis will be further up the belly from the anus than a female's vulva.
If distance is difficult to determine due to the animal's anatomy or simple unfamiliarity with the appearance of the animal's body parts, closely examine the shape of the part. A male's penis sheath will have a narrow, puckered appearance, whereas a female's vulva will be smoother, less raised, and have a tiny vertical slit in the middle. The penis also has a tiny opening in the middle for urination, but that opening is round and looks like a pinhole. The vulva also forms a distinct "Y" shape with the anus as the staff and the bottom of the vulva as the two top bars, whereas the penis forms a shape with the anus like a lowercase "i", the dot being the penis and the staff being the anus. Gentle pressure above the genital region will encourage a male's shaft to extrude from the sheath.
Finally, if still in doubt, owners can palpitate the animal's testicles by firmly grasping either side of the genital region.