By: Sarah Pruitt

How Codebreakers Helped Secure U.S. Victory in the Battle of Midway

Advanced intelligence helped the Allies turn the tables on Japan in this crucial World War II naval battle.

The Battle of Midway

MPI/Getty Images

Published: November 06, 2019

Last Updated: January 31, 2025

In May 1942, U.S. and Australian naval and air forces were facing off against the Imperial Japanese Navy in the Battle of the Coral Sea in the South Pacific. But in a windowless basement at Pearl Harbor, a group of U.S. Navy codebreakers had intercepted Japanese radio messages suggesting Japan was planning an entirely different—and potentially far more damaging—operation in the Pacific theater.

Led by Lieutenant Commander Joseph Rochefort, the team of cryptanalysts and linguists made up the U.S. Navy’s Combat Intelligence Unit (better known as Station Hypo). By April 1942, they had gotten so good at breaking Japan’s main operational code, which they dubbed JN-25b, that they were able to intercept, decrypt and translate parts of Japan’s radio messages within hours of when they were sent.

Battle of Midway Tactical Overview - World War II

Seven months after the attack on Pearl Harbor, American and Japanese forces clashed over Midway Atoll, a dot of land in the middle of the Pacific Ocean. The Battle of Midway tested intelligence and combat capabilities on both sides – while decidedly altering the outcome of World War II.

'AF' Identified as Code for Midway

The radio traffic they intercepted that May suggested that Admiral Isoroku Yamamoto, the mastermind behind the Pearl Harbor attack, was preparing a major invasion, involving four Japanese aircraft carriers along with many other ships, at a location designated with the initials “AF.”

Station Hypo had little doubt as to what “AF” referred to: the U.S. naval and air base on Midway Atoll, two tiny islands located in the central Pacific, around 1,200 miles northwest of Pearl Harbor. Back in March, a Japanese plane reporting weather conditions near the islands had also mentioned “AF,” suggesting strongly that the designator referred to Midway.

But not everyone was convinced the codebreakers were right.

“Rochefort’s job was to gather information, raw data for the most part, and send [it] to Washington,” says Craig Symonds, professor of maritime history at the Naval War College and author of The Battle of Midway. Officially, Rochefort reported to Captain John R. Redman, director of OP-20-G, the Navy’s Code and Signals Section.

Redman’s department would then put together that data with intelligence acquired from other locations and send it all out to the operational commanders, including Admiral Chester W. Nimitz, commander in chief of the U.S. Pacific Fleet at Pearl Harbor.

In practice, however, Rochefort chose to bypass this chain of command and communicate Station Hypo’s findings directly to Nimitz’s intelligence officer, Lieutenant Commander Edwin T. Layton. Layton and Rochefort were friends and had spent three years together in Japan earlier in their careers, studying the language and culture.

This side channel “worked great within the theater, but you can see how folks in Washington would say [that] Rochefort is short-circuiting the system,” Symonds says. “That's not the way this is supposed to work.”

Battle of Midway

The U.S. Navy’s decisive victory in the Battle of Midway (June 3-6, 1942) dashed Japan’s hopes of neutralizing the United States as a naval power and turned the tide of World War II in the Pacific. Here, a squadron of Douglas “Devastator” torpedo bombers unfold their wings for a takeoff from the USS Enterprise during the battle. The carrier’s scout and torpedo bombers made direct hits on three Japanese carriers and a Japanese battleship.

Bettmann Archive/Getty Images

Battle of Midway

American Navy torpedo bombers fly over a burning Japanese ship near Midway.

Time Life Pictures/US Navy/The LIFE Picture Collection/Getty Images

Battle of Midway

The hulk of a Japanese heavy cruiser, Mikuma, smolders after being hit by American bombers.

Time Life Pictures/US Navy/The LIFE Picture Collection/Getty Images

Battle of Midway

A general view of damage on Midway Island before Japanese raiders were repelled.

Corbis/Getty Images

Battle of Midway

A Navy photographer aboard the stricken U.S.S. Yorktown aircraft carrier took this photo after the ship had been hit by bombs and torpedoes. The carrier came out of the battle in fairly good condition for salvage but was torpedoed again on June 6th and sank the following day.

Bettmann Archive/Getty Images

Smoke and spray from the guns of the American aircraft carrier USS Yorktown fill the horizon as Japanese torpedo bombers approach.

Time Life Pictures/US Navy/The LIFE Picture Collection via Getty Images

Battle of Midway

A fire-fighting detail works through a pall of smoke aboard the USS Yorktown after its bombing by Japanese forces.

Corbis/Getty Images

Battle of Midway

A destroyer comes to the aid of the listing aircraft carrier USS Yorktown, which was hit by Japanese bombs and torpedoes during the Battle of Midway. June 1942.

Corbis/Getty Images

Battle of Midway

A destroyer picks up the crew of the aircraft carrier USS Yorktown, which was damaged by Japanese bombs and torpedoes.

Corbis/Getty Images

Battle of Midway

US troops stand at attention behind the flag-draped coffins of their countrymen killed in the battle of Midway, Midway Island, June 1942.

Underwood Archives/Getty Images

Codebreakers Set a Trap to Confirm Japanese Attack

Rather than accept Midway as the target, Redman and others in Washington suspected the Japanese might be preparing another attack in the South Pacific, against Port Moseby, New Caledonia or Fiji, or even an attack on Hawaii or the U.S. West Coast.

Determined to dispel such doubts, Rochefort’s team famously devised a ruse. Via submarine, they sent a message to the base on Midway instructing personnel there to radio Pearl Harbor that the salt-water evaporators on the base had broken down. Two days later, a Japanese message was intercepted that reported “AF” was running out of fresh drinking water.

“That's not how we found out Midway was the target, [though] it’s often interpreted that way,” Symonds clarifies. “We knew...or Rochefort knew, anyway. Rochefort did it to help convince Washington that he knew what he was talking about.”

By the end of May, Navy cryptanalysts had figured out more details about Yamamoto’s plans, including almost the entire order of battle of the Imperial Navy. With this information, Nimitz was able to plot a strategy that would take the Japanese by surprise, assembling three U.S. aircraft carriers at a spot some 300 miles north of Midway, which they called “Point Luck.” This included the USS Yorktown, which had sustained serious damage during the Battle of the Coral Sea but was repaired in just two days in the Pearl Harbor Navy Yard.

US Victory at Battle of Midway Marks Turning Point in WWII

Grueling Fight for Control of Guadalcanal

American fighter pilots take on the Japanese in a grueling fight for control of Guadalcanal.

Code-breaking alone doesn’t explain the stunning Allied victory in the Battle of Midway (June 4-7, 1942), according to Symonds. But, he says, it does explain why “American decision-makers, and particularly Chester Nimitz, knew enough to take what at the time seemed to many to be a risky move—committing all three of his existing aircraft carriers, including the Yorktown, which was pretty beat up from the Battle of the Coral Sea, and sending them up north of Midway in an ambush position.”

The Pacific War would continue for another three years, costing many more lives on both sides, but the Allied victory in the Battle of Midway marked a crucial turning point. Before the battle, Japan had proved virtually unstoppable in the Pacific. At Midway, the Imperial Navy lost all four aircraft carriers involved in the assault, as well as more than 300 aircraft and as many as 3,000 men, including some of their most experienced pilots. A month later, the Allies would launch their first major offensive at Guadalcanal, taking the initiative in the Pacific War for the first time.

“Up until June 4, 1942, all conflict was initiated by the Japanese,” Symonds says. “The Japanese were essentially making the decisions about where battles would be fought and initiating them. After June 4, the Japanese really did not initiate any new offensives at all, and the Americans did.”

Related Articles

About the author

Sarah Pruitt is a writer and editor based in seacoast New Hampshire. She has been a frequent contributor to History.com since 2005, and is the author of Breaking History: Vanished! (Lyons Press, 2017), which chronicles some of history's most famous disappearances.

Fact Check

We strive for accuracy and fairness. But if you see something that doesn't look right, click here to contact us! HISTORY reviews and updates its content regularly to ensure it is complete and accurate.

Citation Information

Article title
How Codebreakers Helped Secure U.S. Victory in the Battle of Midway
Website Name
History
Date Accessed
March 21, 2025
Publisher
A&E Television Networks
Last Updated
January 31, 2025
Original Published Date
November 06, 2019

History Revealed

Sign up for "Inside History"

Get fascinating history stories twice a week that connect the past with today’s world, plus an in-depth exploration every Friday.

By submitting your information, you agree to receive emails from HISTORY and A+E Global Media. You can opt out at any time. You must be 16 years or older and a resident of the United States.

King Tut's gold mask