Pregnancy tests detect the presence of a hormone called human chorionic gonadotropin (hCG) in urine or blood. If hCG is present, it indicates pregnancy.