On December 7 1941 the Japanese had made a surprise attack on the American Navy base Pearl Harbour on Hawaii triggering the U.S. entry into World War II. Six Japanese carriers, Akagi, Kaga, Sōryū, Hiryū, Shōkaku, and Zuikaku, was the mainstay of the attack force. Over the next seven hours there were coordinated Japanese attacks on the U.S.-held Philippines, Guam and Wake Island and on the British Empire in Malaya, Singapore, and Hong Kong. The Japanese victories came swift and most of the colonies and protectorates in East Asia was over run.
But Admiral Isoroku Yamamoto still considered the American carriers as a threat to their continued expansion. Specially since Lt. Col. James "Jimmy" Doolittle's raid on the Japanese mainland in April 1942 performed by B-25B Mitchell bombers launched from the carrier USS Hornet (CV-8) A plan to lure the American carriers out to sink them was forged.
Yamamoto originally wanted to attack Pearl Harbour again but since the first attack the base had been substantially reinforced and had a strong defence. It was therefore decided to attack Midway instead, a tiny atoll at the extreme northwest end of the Hawaiian Islands chain and out of range of the air defences stationed at Pearl Harbour. It was a strategic outpost with an airfield, later called the Henderson Field, and a refueling port for the U.S. Navy. This base took up the entire atoll.
The Japanese plan was to send in a carrier force and bomb the island and followed by a heavier navy force to hit and invade the island. Thus they hoped to lure out the American carriers and sink them. At that time they thought the Americans only had two carriers left, the USS Enterprise and the USS Hornet, after they'd sunk USS Lexington and believed they also sunk the USS Yorktown in the Battle of the Coral Sea. However the Yorktown had been saved and quickly repaired and was back in service.
Also unbeknown to the Japanese the Americans at Station HYPO under the lead of Joseph Rochefort had broken the main Japanese naval code and could therefore listen in on the Japanese communication. They had picked up that the Japanese planned a big attack but knew only that the target was coded "AF". However they guessed it could be Midway so they sent out a message from midway, in clear text, that they had problem with the main water supply. Sure enough they soon picked up a coded message that "AF" had problem with their water supply. So the Americans knew they were coming and could send their navy to set up a trap and also beef up the defences at Midway with what planes they could spare and more AA-batteries.
The Japanese carrier force was lead by Vice Admiral Chūichi Nagumo and featured four main carriers the Akagi, the Hiryū, the Kaga and the Sōryū, all known from the Pearl Harbour attack. They were accompanied by only two battleships, three cruisers and twelve destroyers. There was also an invasion fleet sailing in parallel with troops that would take over Midway. A larger force of surface vessels lead by admiral Yamamoto was trailing behind and supposed to arrive later to mop up.
The stage was set.