Despite its relative invisibility to the public, the administration of military justice during the Civil War played a vital role in maintaining the discipline necessary for Union military success. While some scholars have criticized the Union military courts as arbitrary and excessively harsh, others have defended it as a necessary means of maintaining order in the face of unprecedented challenges faced by the Union. Drawing on extensive primary research, this history presents a compelling narrative based on a statistical analysis of 5,000 Union military trials, court records, historical legal publications, and insights from contemporary historians. This work analyzes the relationship between alcohol misuse and misconduct, covers the differing approaches to sexual misconduct across the services, and exposes the uneven and sometimes unfair application of military justice. Offering a balanced perspective on the struggle between maintaining discipline and protecting the legal rights of service members, this history is the first of its kind.