During the Second World War a major part of the strategy of the Grand Alliance was shipping. The Germans fully appreciated the vulnerability of this and their attack on it, largely by means of submarines, became known as the Battle of the Atlantic. The attack was overcome, with some difficulty, by a number of means. One, which remained generally unknown until the 1970s, was the decryption of German coded signals, now usually called Ultra. Subsequent histories often tended to attribute the outcome of the Battle largely to the operation of this factor almost by itself, sometimes because of a lack of rigorous analysis and also because of a failure to set this important subject into the full and complex contexts in which it operated. This study rectifies this deficiency, setting out the full story of the series of campaigns and carefully assessing the complicated pattern of factors, thus allowing a much more balanced understanding of code-breaking.