The state of war between Japan and the Allied powers formally ended on April 28, 1952.
Japan’s surrender and the end of a state of war were separate legal milestones. The Instrument of Surrender ended active hostilities on September 2, 1945, but the formal peace settlement came later through the Treaty of San Francisco.
That treaty was signed on September 8, 1951, and entered into force on April 28, 1952. Its effective date ended the legal state of war between Japan and most of the Allied powers and restored Japan’s sovereignty after the occupation.
The Soviet Union did not sign the treaty. Japan and the Soviet Union later formally ended their state of war through the Soviet-Japanese Joint Declaration of 1956, which is why accounts sometimes distinguish the general peace settlement from Japan’s relationship with the Soviet Union.