Male infertility refers to a male's inability to cause pregnancy in a fertile female. In humans it accounts for 40–50% of infertility. It affects approximately 7% of all men.Male infertility is commonly due to deficiencies in the semen, and semenquality is used as a surrogate measure of male fecundity.

Male infertility is due to low sperm production, abnormal sperm function or blockages that prevent the delivery of sperm. Illnesses, injuries, chronic health problems, lifestyle choices and other factors can play a role in causing male infertility. 

Methods of Diagnosis 

Scrotal  ultrasound. This  test uses high-frequency sound waves to produce images inside the body. A scrotal ultrasound can help the doctor see if there is a varicocele or other problems in the testicles and supporting structures. 

Hormone testing. Hormones produced by the pituitary gland, hypothalamus and testicles play a key role in sexual development and sperm production. Abnormalities in other hormonal or organ systems might also contribute to infertility. A blood  test measures the level of testosterone and other hormones. 

Post-ejaculation urinalysis. Sperm in your urine can indicate that sperm are traveling backward into the  bladder instead of out your penis during ejaculation (retrograde ejaculation). 

Genetic tests. When sperm concentration is extremely low, there could be a genetic cause. A blood test can reveal whether there are subtle changes in the Y chromosome — signs of a genetic abnormality. Genetic testing might be ordered to  diagnose various congenital or inherited syndromes. 

Testicular  biopsy. This  test involves removing samples from the testicle with a needle. If the results of the testicular biopsy show that sperm production is normal, then the problem is likely caused by a blockage or another problem with sperm transport. However, this test is not commonly used to diagnose the cause of infertility.

Specialized  sperm function tests. A number of tests can be used to check how well the sperm survive after ejaculation, how well they can penetrate an egg, and whether there's any problem attaching to the egg. Generally, these tests are  rarely performed and often do not significantly change recommendations for treatment. 

Transrectal  ultrasound. A small, lubricated wand is inserted into the rectum. It allows the doctor to check prostate, and look for blockages of the tubes that carry semen (ejaculatory ducts and seminal vesicles).