SOS is a Morse code distress signal (▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄), used internationally, that was originally established for maritime use. In formal notation SOS is written with an overscore line, to indicate that the Morse code equivalents for the individual letters of "SOS" are transmitted as an unbroken sequence of three dots / three dashes / three dots, with no spaces between the letters. In International Morse Code three dots form the letter "S" and three dashes make the letter "O", so "S O S" became a common way to remember the order of the dots and dashes. (IWB, VZE, 3B, and V7 form equivalent sequences, but traditionally SOS is the easiest to remember.)
Although SOS officially is just a distinctive Morse code sequence that is not an abbreviation for anything, in popular usage it is associated with phrases such as "Save Our Souls" and "Save Our Ship". Moreover, due to its high profile use in emergencies, the phrase "SOS" has entered general usage to informally indicate a crisis or the need for action.
SOS originated in German government maritime radio regulations adopted effective 1 April 1905. It became a worldwide standard when it was included in the service regulations of the first International Radiotelegraph Convention signed on 3 November 1906, which became effective on 1 July 1908. In modern terminology, SOS is a Morse "procedural signal" or "prosign", used as a start-of-message mark for transmissions requesting assistance when loss of life or catastrophic loss of property is imminent. Other prefixes are used for mechanical breakdowns, requests for medical assistance, and a relayed distress signal originally sent by another station. SOS remained the maritime radio distress signal until 1999, when it was replaced by the Global Maritime Distress and Safety System.
SOS is still recognized as a standard distress signal that may be used with any signaling method. It has been used as a visual distress signal, consisting of three short/three long/three short flashes of light, such as from a survival mirror. In some cases the individual letters "S O S" have been spelled out, for example, stamped in a snowbank or formed out of logs on a beach. The fact that "S O S" can be read right side up as well as upside down (as an ambigram) is an advantage for visual recognition.
Radio (initially known as "wireless telegraphy") was developed in the late 1890s, and was quickly recognized as an important aid to maritime communication. Previously seagoing vessels had adopted a variety of standardized visual and audio distress signals, using such things as semaphore flags, signal flares, bells, and foghorns. However, initially cooperation in standardizing radio distress signals was limited by national differences and rivalries between competing radio companies.
In 1903, an Italian representative at the Berlin Preliminary Conference on Wireless Telegraphy, Captain Quintino Bonomo, discussed the need for common operating procedures, including the suggestion that "ships in distress... should send the signal SSS DDD at intervals of a few minutes". However, procedural questions were beyond the scope of this conference, so no standard signal was adopted at the time, although Article IV of conference's Final Protocol stated that "Wireless telegraph stations should, unless practically impossible, give priority to calls for help received from ships at sea", 
In the absence of international regulations, individual organizations were left to develop their own practices. On 7 January 1904 the Marconi International Marine Communication Company issued "Circular 57", which specified that, for the company's worldwide installations, beginning 1 February 1904 "the call to be given by ships in distress or in any way requiring assistance shall be 'C.Q.D.'". An alternative proposal, put forward in 1906 by the U.S. Navy, suggested that the International Code of Signals flag signals should be adopted for radio use, including "NC", which stood for "In distress; want immediate assistance".
Germany was first country to adopt the SOS distress signal, which it called the Notzeichen signal, as one of three Morse code sequences included in national radio regulations which became effective on 1 April 1905. In 1906, the first International Radiotelegraph Convention met in Berlin, which produced an agreement signed on 3 November 1906 that become effective on 1 July 1908. The convention adopted an extensive collection of Service Regulations, including Article XVI, which read: "Ships in distress shall use the following signal: ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ repeated at brief intervals".
In both the 1 April 1905 German law and the 1906 international regulations, the distress signal is specified as a continuous Morse code sequence of three dots / three dashes / three dots, with no mention of any alphabetic equivalents. However, in International Morse, three dots comprise the letter "S", and three dashes the letter "O", and it soon became common to informally refer to the distress signal as "S O S", with the 12 January 1907 Electrical World stating that "Vessels in distress use the special signal, SOS, repeated at short intervals." (In American Morse code, which was used by many coastal ships in the United States through the first part of the twentieth century, three dashes stood for the numeral "5", so in a few cases the distress signal was informally referred to as "S 5 S".)
The first ships that have been reported to have transmitted an SOS distress call were the Cunard liner RMS Slavonia on 10 June 1909 while sailing the Azores, and the steamer SS Arapahoe on 11 August 1909 while off the North Carolina coast. The signal of the Arapahoe was received by the United Wireless Telegraph Company station at Hatteras, North Carolina, and forwarded to the steamer company's offices. However, there was some resistance among Marconi operators to adopting the new signal, and as late as the April 1912 sinking of the RMS Titanic the ship's Marconi operators intermixed CQD and SOS distress calls. In the interests of consistency and water safety, the use of CQD appears to have died out thereafter.
Additional warning and distress signals followed the introduction of SOS. On 20 January 1914, the London International Convention on Safety of Life at Sea adopted as the "Safety Signal" the Morse code sequence "TTT" ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ (three "T's" (▄▄▄▄▄▄)) -- spaced normally as three letters so as not to be confused with the three dashes of the letter O (▄▄▄▄▄▄▄▄▄▄▄▄▄▄) -- and used for messages to ships "involving safety of navigation and being of an urgent character".
With the development of audio radio transmitters, there was a need for a spoken distress phrase, and "Mayday" (from French m'aidez "help me") was adopted by the 1927 International Radio Convention as the spoken equivalent of SOS. For "TTT", the equivalent spoken signal is "Sécurité" (from French sécurité "safety") for navigational safety, while "Pan-pan" (from French panne "breakdown") signals an urgent but not immediately dangerous situation. French was the international language at the time that these were formalized.
During World War II, additional codes were employed to include immediate details about attacks by enemy vessels, especially in the Battle of the Atlantic. The signal "SSS" signaled attacked by submarines, while "RRR" warned of an attack by a surface raider, "QQQ" warned of an unknown raider (usually an auxiliary cruiser), and "AAA" indicated an attack by aircraft. They were usually sent in conjunction with the SOS distress signal. All of these codes later switched from three repeats of the letter to four repeats, e.g., "RRRR".
None of these signals were used on their own. Sending SOS as well as the urgency signal ("XXX" in CW, and "PAN-PAN" in voice) and safety signal ("TTT" in CW, and "SECURITE" in voice) used similar procedures for effectiveness. These were always followed correctly. Following is a hypothetical example of an SOS signal; the portions in parentheses are an explanation only.
SOS SOS SOS (urgent distress call follows)
DE (from) GBTT GBTT GBTT (GBTT identifies the Queen Elizabeth 2 radio room, repeated 3 times)
(Ship) QUEEN ELIZABETH 2 PSN (position) 49 06 30 N (North latitude) 04 30 20 W (West longitude)
(Our ship is) ON FIRE (and the crew is) ABANDONING SHIP
AR (End of Message) K (reply, anyone)
Since many merchant vessels carried only one or two radio operators, no one might hear a distress signal when both operators were off-duty. Eventually, equipment was invented to summon operators by ringing an alarm in the operator's cabin, and on the bridge, and the only switch able to disable the alarm was only permitted to be in the wireless telegraph room. The alarm was sent by the operator on the ship in distress transmitting the radiotelegraph alarm signal (auto-alarm) signal--twelve extra-long dashes, each lasting four seconds with a one-second gap between them, and transmitted in A2 (modulated CW). The alarm signal was normally sent with a mechanical or electronic timing circuit to ensure it was sent accurately. However, ships radio room clocks typically had markings on the dial to guide operators in sending the signal manually. The regulations for the auto-alarm were defined in the 1927 Safety of Life at Sea (SOLAS) international maritime regulations, and in Article 19, § 21, of the General Regulations annexed to the International Radiotelegraph Convention, 1927.5 5.
The Auto Alarm receivers were designed to activate upon receiving four such dashes. Once four valid dashes are detected, the automatic alarm is activated. The distressed ship's operator would then delay sending the SOS message itself to give off-watch radio operators time to reach their radio room.
The radiotelephony equivalent of the radiotelegraph alarm signal is the radiotelephony alarm signal, which is the transmission of alternating tones of 2200 Hz and 1300 Hz, with each tone having a duration of 250 ms. Automatic alarm systems aboard ships must activate when such a signal is received and the receiving vessel is within 500 nmi (930 km) of the receiving vessel's position, or if the distress position is in the polar areas (latitude greater than 70° N or 70° S). The alarm should also activate when the call is received and the distance between the vessel in distress and the receiving vessel cannot be determined.