A court-martial or court martial (plural courts-martial or courts martial, as "martial" is a postpositive adjective) is a military court or a trial conducted in such a court. A court-martial is empowered to determine the guilt of members of the armed forces subject to military law, and, if the defendant is found guilty, to decide upon punishment. In addition, courts-martial may be used to try prisoners of war for war crimes. The Geneva Convention requires that POWs who are on trial for war crimes be subject to the same procedures as would be the holding military's own forces. Finally, courts-martial can be convened for other purposes, such as dealing with violations of martial law, and can involve civilian defendants.
Most navies have a standard court-martial which convenes whenever a ship is lost; this does not presume that the captain is suspected of wrongdoing, but merely that the circumstances surrounding the loss of the ship be made part of the official record. Most military forces maintain a judicial system that tries defendants for breaches of military discipline. Some countries like France and Germany have no courts-martial in times of peace and use civilian courts instead.
Usually, a court-martial takes the form of a trial with a presiding judge, a prosecutor and a defense attorney (all trained lawyers as well as officers). The precise format varies from one country to another and may also depend on the severity of the accusation.
Courts-martial have the authority to try a wide range of military offences, many of which closely resemble civilian crimes like fraud, theft or perjury. Others, like cowardice, desertion, and insubordination, are purely military crimes. Military offences are defined in the Armed Forces Act 2006 for members of the British Military. Regulations for the Canadian Forces are found in the Queen's Regulations and Orders as well as the National Defence Act. For members of the United States Armed Forces offenses are covered under the Uniform Code of Military Justice (UCMJ). These offences, as well as their corresponding punishments and instructions on how to conduct a court-martial, are explained in detail based on each country and/or service.
In Canada, there is a two-tier military trial system. Summary trials are presided over by superior officers, while more significant matters are heard by courts martial, which are presided over by independent military judges serving under the independent Office of the Chief Military Judge. Appeals are heard by the Court Martial Appeal Court of Canada. Capital punishment in Canada was abolished generally in 1976, and for military offences in 1998. Harold Pringle was the last Canadian soldier executed, in 1945, for a military offence.
In Finland, the military has jurisdiction over two types of crimes: those that can be committed only by military personnel and those normal crimes by military persons where both the defendant and the victim are military persons or organizations and the crime has been defined in law as falling under military jurisdiction. The former category includes e.g. various types of disobedience and absence without leave, while the latter category includes e.g. murder, assault, theft, fraud and forgery. However, war crimes and sexual crimes are not under military jurisdiction. 
In crimes where the military has jurisdiction, the military conducts the investigation. In non-trivial cases, this is done by the investigative section of Defence Command or by civilian police, but trivial cases are investigated by the defendant's own unit. The civilian police has always the right to take the case from the military. 
If the case does not warrant a punishment greater than a fine or a disciplinary punishment, the punishment is given summarily by the company, battalion or brigade commander, depending on severity of the crime. If the brigade commander feels that the crime warrants a punishment more severe than he can give, he refers the case to the local district attorney who commences prosecution. 
The crimes with military jurisdiction are handled by the civilian district court which has a special composition. In military cases, the court consists of a civilian legally trained judge and two military members: an officer and a warrant officer, an NCO or a private soldier. The verdict and the sentence are decided by a majority of votes. However, the court cannot give a more severe sentence than the learned member supports. The appeals can be made as in civilian trials. If a court of appeals handles a military matter, it will have an officer member with at least a major's rank. The Supreme Court of Finland has, in military cases, two general officers as members. 
Courts-martial proper are instituted only during a war, by the decree of the government. Such courts-martial have jurisdiction over all crimes committed by military persons. In addition, they may handle criminal cases against civilians in areas where ordinary courts have ceased operation, if the matter is urgent. Such courts-martial have a learned judge as a president and two military members: an officer and an NCO, warrant officer or a private soldier. The verdicts of a war-time court-martial can be appealed to a court of appeals. 
The Basic Law (Grundgesetz) (adopted after the Second World War in 1949) establishes in Art. 96 para. 2 that courts-martial can be established by federal law. Such courts-martial would take action in a State of Defense (Verteidigungsfall) and only against soldiers abroad or at sea. However, no such law has been passed to date and German soldiers are tried exclusively before civil courts.
There are four kinds of courts-martial in India. These are the General Court Martial (GCM), District Court Martial (DCM), Summary General Court Martial (SGCM) and Summary Court Martial (SCM). According to the Army Act, army courts can try personnel for all kinds of offenses, except for murder and rape of a civilian, which are primarily tried by a civilian court of law. Higher government authorities do not deal with the military doctrines. The President of India can use his judicial power, (Article 72), to give either pardon, reprieve, respite or remission of punishment or sentence given by a court martial.
In Luxembourg, there are three levels of military jurisdiction:
The lowest is the Council of War which is composed of one Lieutenant-Colonel (or higher), one Captain (or higher) and one civilian judge of a District Court.
The Military Court of Appeal is composed of two high magistrates of a civilian Court of Appeal and one Major (or higher).
At the top is the Military High Court which deals not only with military cases, but also with acts of high treason, sabotage, organized forms of terrorism and crimes against humanity. It is composed of two magistrates of a civilian Court of Appeal, one judge of a civilian District Court and one Lieutenant-Colonel (or higher) of the Army.
Service members of the New Zealand Defence Force are tried under a Court Martial for offences pertaining to the most serious offences against the Armed Forces Discipline Act 1971. Offences such as such as mutiny, murder, sexual offences, serious assaults, drug offences, or offences where the maximum punishment exceeds a 7 year prison term will be heard by Court Martial. Below this 7 year threshold the accused is dealt with by their Commanding Officer in what is known as a Summary Trial.
During Court Martial the appointed judge is either a New Zealand High Court or District Court Judge and he or she presides over the trial. Defendants are assigned Legal Counsel, and for the prosecution, a lawyer is assigned who generally comes from a military background. The Judge Advocate is usually made up of senior NZDF Officers and Warrant Officers who hear the defence and prosecution evidence during Court Martial. Punishment on Guilty findings of a defendant will see them face being charged with a punishment such as serious reprimand, loss of rank, dismissal from the NZDF, or being sent to military or civilian prison.
Under the Singapore Armed Forces Act, any commissioned officer is allowed to represent servicemen when they are tried for military offences in the military courts. The cases are heard at the Court-Martial Centre at Kranji Camp II. Some of the early day courts martial in Singapore include CPT G. R. Wadsworth due to use of insubordination language and in the modern day misbehaviours by conscripted servicemen.
The Court Martial is one of the Military Courts of the United Kingdom. The Armed Forces Act 2006 establishes the Court Martial as a permanent standing court. Previously courts-martial were convened on an ad hoc basis with several traditions, including usage of swords. The Court Martial may try any offence against service law. The Court is made up of a Judge Advocate, and between three and seven (depending on the seriousness of the offence) officers and warrant officers. Rulings on matters of law are made by the Judge Advocate alone, whilst decisions on the facts are made by a majority of the members of the court, not including the Judge Advocate, and decisions on sentence by a majority of the court, this time including the Judge Advocate.
Most commonly, courts-martial in the United States are convened to try members of the U.S. military for violations of the Uniform Code of Military Justice (UCMJ), which is the U.S. military's criminal code. However, they can also be convened for other purposes, including military tribunals and the enforcement of martial law in an occupied territory. Courts-martial are governed by the rules of procedure and evidence laid out in the Manual for Courts-Martial, which contains the Rules for Courts-Martial, Military Rules of Evidence, and other guidance. There are three types: Special, Summary, and General.
In Herman Melville's novella Billy Budd (first published 1924), the title character is convicted at a drumhead court-martial of striking and killing his superior officer on board HMS Indomitable, is sentenced to death, and is hanged. The novella has been adapted for the stage, film and television; notably in Benjamin Britten's 1951 opera Billy Budd.
In C. S. Forester's 1938 novel Flying Colours, Captain Horatio Hornblower is court-martialed for the loss of HMS Sutherland. He is "most honourably acquitted".
Military trial films