The Swiss Armed Forces (German: Schweizer Armee, French: Armée suisse, Italian: Esercito svizzero, Romanisch: Armada svizra) operates on land, in the air, and in international waters.
The structure of the Swiss militia system stipulates that the soldiers keep their own personal equipment, including all personally assigned weapons, at home (until 2007 this also included ammunition ). Compulsory military service applies to all male Swiss citizens, with women serving voluntarily. Males usually receive initial orders at the age of 18 for military conscription eligibility screening. About two-thirds of young Swiss men are found suitable for service, while alternative service exists for those found unsuitable.  Annually, approximately 20,000 persons are trained in basic training for 18 weeks (23 weeks for special forces).
The reform "Army XXI" was adopted by popular vote in 2003.
The land component of the Swiss Armed Forces originated from the cantonal troops of the Old Swiss Confederacy, called upon in cases of external threats by the Tagsatzung or by the canton in distress. In the federal treaty of 1815, the Tagsatzung prescribed cantonal troops to put a contingent of 2% of the population of each canton at the federation's disposition, amounting to a force of some 33,000 men. The cantonal armies were converted into the federal army (Bundesheer) with the constitution of 1848. From this time, it was illegal for the individual cantons to declare war or to sign capitulations or peace agreements. Paragraph 13 explicitly prohibited the federation from sustaining a standing army, and the cantons were allowed a maximum standing force of 300 each (not including the Landjäger corps, a kind of police force). Paragraph 18 declared the "obligation" of every Swiss citizen to serve in the federal army if conscripted (Wehrpflicht), setting its size at 3% of the population plus a reserve of one and one half that number, amounting to a total force of some 80,000.
The first complete mobilization, under the command of Hans Herzog, was triggered by the Franco-Prussian War in 1871. In 1875, the army was called in to crush a strike of workers at the Gotthard tunnel. Four workers were killed and 13 were severely wounded.
Paragraph 19 of the revised constitution of 1874 extended the definition of the federal army to every able-bodied male citizen, swelling the size of the army (at least in theory) from under 150,000 to more than 700,000, with population growth during the 20th century rising further to some 1.5 million, the second largest armed force per capita after the Israeli Defence Forces.
A major manoeuvre commanded in 1912 by Ulrich Wille, a reputed Germanophile, convinced visiting European heads of state, in particular Kaiser Wilhelm II, of the efficacy and determination of Swiss defences.  Wille was subsequently put in command of the second complete mobilization in 1914, and Switzerland escaped invasion in the course of World War I. Wille also ordered the suppression of the 1918 general strike (Landesstreik) with military force. Three workers were killed, and a rather larger number of soldiers died of the Spanish flu during mobilization. In 1932, the army was called to suppress an anti-fascist demonstration in Geneva. The troops shot dead 13 demonstrators, wounding another 65. This incident long damaged the army's reputation, leading to persistent calls for its abolition among left-wing politicians. In both the 1918 and the 1932 incidents, the troops deployed were consciously selected from rural regions such as the Berner Oberland, fanning the enmity between the traditionally conservative rural population and the urban working class. The third complete mobilization of the army took place during World War II under the command of Henri Guisan (see also Switzerland during the World Wars). The Patrouille des Glaciers race, created to test the abilities of soldiers, was created during the war.
In the 1960s and 1970s, the armed forces were organised according to the "Armee 61" structure.
Since 1989, there have been several attempts to curb military activity or even abolish the armed forces altogether.
In 1989, the status of the army as a national icon was shaken by a popular initiative aiming at its complete dissolution (see: Group for a Switzerland without an Army ) receiving 35.6% support. This triggered a series of reforms and, in 1995, the number of troops was reduced to 400,000 ("Armee 95"). Article 58.1 of the 1999 constitution repeats that the army is "in principle" organized as a militia, implicitly allowing a small number of professional soldiers. A second initiative aimed at the army's dissolution in late 2001 received a mere 21.9% support.  Nevertheless, the army was shrunk again in 2004, to 220,000 men ("Armee XXI"), including the reserves.
In 2016, the Swiss Federal Assembly voted to further reduce the army from 140,000 men to 100,000 men, reducing the time of basic training from 21 weeks to 18, but also to increase the military budget by 2.4 billion Swiss francs. 
The armed forces consist of 134,886 people on active duty (in Switzerland called Angehöriger der Armee, shortly AdA, engl.: Member of the Army), of which 4,230 are professionals, with the rest being conscripts or volunteers.  Women, for whom military service is voluntary, numbered 1,050: less than 1% of the total, but 25% of career soldiers.  Once decided to serve, they have the same rights and duties as their male colleagues, and they can join all services, including combat units. Recruits are generally instructed in their native language; however, the small number of Romansh-speaking recruits are instructed in German.
In contrast to most other comparable armed forces, officer candidates are usually not career regulars: after seven weeks of basic training, selected recruits are offered the possibility of a cadre function.
In peacetime, the armed forces are led by the Chief of the Armed Forces (Chef der Armee), who reports to the head of the Federal Department of Defence, Civil Protection and Sports and to the Swiss Federal Council as a whole. The current Chief of the Armed Forces is Lieutenant-General (Korpskommandant ) Philippe Rebord. Lt-Gen Rebord replaced Lieutenant-General (Korpskommandant) André Blattmann on 1 January 2017.
In times of crisis or war, the Federal Assembly elects a full General (OF-9) as Commander-in-Chief of the Armed Forces (Oberbefehlshaber der Armee). The rank is distinct and particular, as it is associated exclusively with wartime fighting or a national crisis due to wartime fighting among the neighbours on the border.  In addition, in Switzerland the word General itself is distinct and particular, as the subordinate appointments of general-officer status omit the word itself.
Throughout Swiss history, there have only been 4 officers formally designated as General: 
- Guillaume Henri Dufour (1847, Sonderbund War;  1849, Baden Revolution;   1856–57, Neuchâtel Crisis; 1859, Second Italian War of Independence)
- Hans Herzog (1871–1872) – Franco-Prussian War
- Ulrich Wille (1914–1918) – World War I
- Henri Guisan (1939–1945) – World War II
In Switzerland, the word General is reserved for the wartime, or emergency, Commander-in-Chief, so the subordinate officers who would have had the title of 'general' in other armies have alternative designations to describe the appointment:
- OF-8: Korpskommandant or Commandant de corps
- OF-7: Divisionär or Divisionnaire
- OF-6; Brigadier 
The distinctive feature of their rank insignia are traditionally stylized edelweiss rank-insignia. One exception, however, is that when Swiss officers are involved in peacekeeping missions abroad, they are often given temporary ranks that do not exist in the Swiss Army, to give them rank-styles readily understood by foreign officers. For example, the head of the Swiss delegation at the NNSC in Korea (see below) had a rank of major general.
Under "Armee 61" the Army was organised into Field Army Corps 1, 2, and 4, and Mountain Army Corps 3.
Since the Army XXI reform in 2004, the basic structure of the Army has been reorganised in the following units: infantry brigades (2 and 5); mountain infantry brigades (9 and 12); armoured brigades (1 and 11).  Additionally two large reserve brigades (Infantry Brigade 7 and Mountain Brigade 10) exist. Four territorial divisions link the Army with the cantons by coordinating territorial tasks inside of their sector and are immediately responsible for the security of their regions, depending only on the decisions of the Federal Council. 
The Swiss Army fields the following brigades: 
- Mechanized Brigade 1 Command Support Battalion 1 (Bataillon d'aide au commandement 1) Reconnaissance Battalion 1 (Bataillon d'exploration 1) Tank Battalion 12 (Bataillon de chars 12) Mechanized Battalion 17 Mechanized Battalion 18 Artillery Battalion 1 Armoured Engineer Battalion 1
- Mechanized Brigade 4 Command Support Battalion 4 Reconnaissance battalion 4 Reconnaissance battalion 5 Artillery Battalion 10 Artillery Battalion 49 Bridge Engineer Battalion 26
- Mechanized Brigade 11 (see de:Panzerbrigade 11) Command Support Battalion 11 Reconnaissance battalion 11 Tank Battalion 13 (Panzerbataillon 13) Mechanized Battalion 14 Mechanized battalion 29 Artillery Battalion 16 (Artillerie Abteilung 16) Armoured Engineer Battalion 11
The four territorial divisions field additional Army units for local defense tasks:
- Territorial Division 1 in Morges Territorial Division Staff Battalion 1 Rifle battalion 1 (Bataillon de Carabiniers 1) Mountain Infantry battalion 7 (Bataillon d'infanterie de montagne 7) Infantry Battalion 13 Rifle battalion 14 (Bataillon de Carabiniers 14) Infantry Battalion 19 (Bataillon d'infanterie 19) Engineer Battalion 2 Emergency Rescue Battalion 1 Rescue Coordination Center 1 Patrouille des Glaciers Command
- Territorial Division 2 in Kriens Territorial Division Staff Battalion 2 Infantry battalion 11 Infantry Battalion 20 Infantry Battalion 56 Infantry Battalion 97 Engineer Battalion 6 Emergency Rescue Battalion 2 Rescue Coordination Center 2
- Territorial Division 3 in Altdorf Territorial Division Staff Battalion 3 Mountain Infantry Battalion 29 Mountain Infantry Battalion 30 (Battaglione fanteria montagna 30) Mountain Infantry Battalion 48 Mountain Infantry Battalion 91 Engineer Battalion 9 Emergency Rescue Battalion 3 Rescue Coordination Center 3
- Territorial Division 4 in St. Gallen Territorial Division Staff Battalion 4 Mountain Rifle Battalion 6 (Gebirgsschützenbataillon 6) Infantry Battalion 61 Infantry Battalion 65 Mountain Infantry Battalion 85 Engineer Battalion 23 Emergency Rescue Battalion 4 Rescue Coordination Center 4
The Swiss Air Force has been traditionally a militia-based service, including its pilots, with an inventory of approximately 456 aircraft whose lengthy service lives (many for more than 30 years) overlapped several eras. However, beginning with its separation from the Army in 1996, the Air Force has been downsizing; it now has a strength of approximately 270 fixed- and rotary-wing aircraft, and is moving towards a smaller, more professional force.
The primary front-line air-defence fleet consists of 30 F/A-18 Hornets (34 aircraft were originally purchased, with three F/A-18D and one F/A-18C lost in crashes) organized into three squadrons (11, 17 and 18) along with 53 F-5 Tiger IIs (98 F-5E and 12 F-5F originally purchased). In October 2008, the Swiss Hornet fleet reached the 50,000 flight hour milestone. 
In peacetime the Swiss Air Force does not maintain 24/7 operational readiness status, due to the limited budget and staff available.
The Onyx system was launched in 2000 in order to monitor both civil and military communications, such as telephone, fax or Internet traffic carried by satellite. It was completed in late 2005 and currently consists of three interception sites, all based in Switzerland. In a way similar to Echelon, Onyx uses lists of keywords to filter the intercepted content for information of interest.
On 8 January 2006, the Swiss newspaper Sonntagsblick (Sunday edition of the Blick newspaper) published a secret report produced by the Swiss government using data intercepted by Onyx. The report described a fax sent by the Egyptian department of Foreign Affairs to the Egyptian Embassy in London, and described the existence of secret detention facilities (black sites) run by the CIA in Central and Eastern Europe. The Swiss government did not officially confirm the existence of the report, but started a judiciary procedure for leakage of secret documents against the newspaper on 9 January 2006.
Several sizeable lakes which lie across international borders are patrolled by a flotilla of military patrol boats. This maritime branch of the Army not only maintains the patrols but also serve in a search-and-rescue role.
During the Second World War, Switzerland fielded the Type 41 class of patrol boats, armed with an anti-tank gun (later replaced by 20mm auto-cannons) and dual machine guns. Nine units were commissioned between 1941 and 1944. These boats were upgraded in 1964, notably receiving radars, radios and modern armament, and were kept in service into the 1980s, the last being decommissioned in late 1983. 
The contemporary force utilises the Aquarius-class (Patrouillenboot 80) riverine patrol boats, which are operated by Motorboat Company 10 of the Corps of Engineers and which patrol lakes Geneva, Lucerne, Lugano, Maggiore and Constance. 
The term 'Admiral of the Swiss Navy' is sometimes used metaphorically to describe a self-important person but it is regarded as US Military slang and unused in Switzerland.
Switzerland has mandatory military service for all able-bodied male citizens, who are conscripted when they reach the age of majority,  though women may volunteer for any position.  People determined unfit for service, where fitness is defined as "satisfying physically, intellectually and psychological requirements for military service or civil protection service and being capable of accomplishing these services without harming oneself or others",  are exempted from service but pay a 3% additional annual income tax until the age of 30, unless they are affected by a disability.  Almost 20% of all conscripts were found unfit for military or civilian service in 2008; the rate is generally higher in urban cantons such as Zurich and Geneva than in the rural ones.  Swiss citizens living abroad are generally exempted from conscription in time of peace  while dual citizenship by itself does not grant such exemption. 
On 22 September 2013, a referendum was held that aimed to abolish conscription in Switzerland.  With a turnout of 47.0% on this particular question, over 73% voted against eliminating conscription.
The prime role of the Swiss Armed Forces is Home Defence.
Operating from a neutral country, Switzerland's army does not take part in armed conflicts in other countries. However, over the years, the Swiss army has been part of several peacekeeping missions around the world.
From 1996 to 2001, the Swiss Army was present in Bosnia and Herzegovina with headquarters in Sarajevo. Its mission, part of the Swiss Peacekeeping Missions, was to provide logistic and medical support to the Organization for Security and Co-operation in Europe (OSCE), protection duties and humanitarian demining. The mission was named SHQSU, standing for Swiss Headquarters Support Unit to BiH. It was composed of 50 to 55 elite Swiss soldiers under contract for six to 12 months. None of the active soldiers were armed during the duration of the mission. The Swiss soldiers were recognized among the other armies present on the field by their distinctive yellow beret. The SHQSU is not the same as the more publicized Swisscoy, which is the Swiss Army Mission to Kosovo.
Switzerland is part of the Neutral Nations Supervisory Commission (NNSC), which was created to monitor the armistice between North and South Korea. Since the responsibilities of the NNSC have been much reduced over the past few years, only five people are still part of the Swiss delegation, which is located near the Korean DMZ.   
Military and civil defence
After World War II, Switzerland began building homes with 40 cm-thick concrete ceilings that might survive firebombing of the type that destroyed Hamburg and Dresden. In the 1960s they began constructing radiation and blast shelters that could survive one to three bars of pressure from a nuclear explosion.  Building codes require blast shelters, which are said to be able to accommodate 114% of the Swiss population.  Small towns have large underground parking garages that can serve as sealed community shelters.  There are also hospitals and command centres in such shelters, aimed at keeping the country running in case of emergencies. Every family or rental agency has to pay a replacement tax to support these shelters, or alternatively own a personal shelter in their place of residence;  many private shelters serve as wine cellars and closets. 
Thousands of tunnels, highways, railroads, and bridges are built with tank traps and primed with demolition charges to be used against invading forces; often, the civilian engineer who designed the bridge plans the demolition as a military officer. Hidden guns are aimed to prevent enemy forces from attempting to rebuild.  Permanent fortifications were established in the Alps, as bases from which to retake the fertile valleys after a potential invasion. They include underground air bases that are adjacent to normal runways; the aircraft, crew and supporting material are housed in the caverns.
However, a significant part of these fortifications was dismantled between the 1980s and during the "Army 95" reformation.
During the Cold War the military expected that any invasion would likely come from the northeast, as the Soviet Union associated the country with NATO despite its stated neutrality.