Fingerprint scanners work by optically or capacitively reading the unique ridge and valley patterns of fingerprints. Optical scanners use cameras to capture fingerprint images while capacitive scanners use semiconductor chips containing arrays of cells to detect ridge patterns. Both analyze fingerprints by measuring the positions of minutiae points, where ridges end or bifurcate, using complex algorithms to recognize and match fingerprints for identification purposes in security and criminal investigations.