A pirate code is a code of conduct for pirates - a set of rules for how to behave. Some of these codes were used by real pirates; others are from movies.

Historical articles of piracy
In the second half of the 17th century, pirates started following rules. These rules had many different names, including Chasse-Partie, Charter Party, Custom of the Coast, or Jamaica Discipline. Eventually, they became known as Articles of Agreement, or the pirate's code.  These changed from one captain to another. Sometimes they were different from one voyage (journey) to another. These rules included punishments for rule breakers and said how much treasure each crew member would receive.

Each crew member signed the articles (or if they could not write, they would make a mark to show they agreed). After the rules were signed, they were then posted in a common place, often the door of the grand cabin.

There are three known sets of these rules that still exist today. Most of these come from Charles Johnson's book A General History of the Pyrates. Part of a code from Henry Morgan, a famous British pirate, is remembered in a book called The Buccaneers of America by Alexandre Exquemelin, who probably sailed with Morgan as a ship's doctor. Very few of these rules still exist today, because often pirates burned the papers before being caught. They did this to prevent these papers from being used against them.

Bartholomew Roberts' articles 
One of the most famous sets of pirate rules was written in 1720 by the famous Welsh pirate Bartholomew Roberts.

I. Every man has a vote in affairs of moment; has equal title to the fresh provisions, or strong liquors, at any time seized, and may use them at pleasure, unless a scarcity (not an uncommon thing among them) makes it necessary, for the good of all, to vote a retrenchment.

(This means that all crew members can vote on issues on the ship. All crew members can have any food or drink they have stolen, unless there is not much to go around.)

II. Every man to be called fairly in turn, by list, on board of prizes because, (over and above their proper share) they were on these occasions allowed a shift of clothes: but if they defrauded the company to the value of a dollar in plate, jewels, or money, marooning was their punishment. If the robbery was only betwixt one another, they contented themselves with slitting the ears and nose of him that was guilty, and set him on shore, not in an uninhabited place, but somewhere, where he was sure to encounter hardships.

(When the pirates stole money or other treasure, every pirate would get a share.  But if one pirate defrauded the group by taking more than his share, he would be punished by marooning - being left alone on an island where there were no other people, with no food or water and no way to escape.  If a pirate stole from one other pirate, the guilty pirate would be punished by having his ears and nose cut, and left on shore.)

III. No person to game at cards or dice for money.

(This means that crew members cannot gamble using money while playing cards or dice)

IV. The lights and candles to be put out at eight o'clock at night: if any of the crew, after that hour still remained inclined for drinking, they were to do it on the open deck.

(This means that all fires had to be put out by 8:00 PM. If crew members wanted to drink after 8:00 PM, then they had to do it on deck.)

V. To keep their piece, pistols, and cutlass clean and fit for service.

(This means that crew members' weapons had to be kept clean)

VI. No boy or woman to be allowed amongst them. If any man were to be found seducing any of the latter sex, and carried her to sea, disguised, he was to suffer death;(so that when any fell into their hands, as it chanced in the Onslow, they put a sentinel immediately over her to prevent ill consequences from so dangerous an instrument of division and quarrel; but then here lies the roguery; they contend who shall be sentinel, which happens generally to one of the greatest bullies, who, to secure the lady's virtue, will let none lie with her but himself.)

(This means that no young boys or women were allowed to be crew members. If a crew member took a woman out to sea in disguise, then he would be killed as punishment.)

VII. To desert the ship or their quarters in battle, was punished with death or marooning.

(This means that if a crew member ran away from battle, he would be killed or left on a deserted island.)

VIII. No striking one another on board, but every man's quarrels to be ended on shore, at sword and pistol. (The quarter-master of the ship, when the parties will not come to any reconciliation, accompanies them on shore with what assistance he thinks proper, and turns the disputant back to back, at so many paces distance; at the word of command, they turn and fire immediately, (or else the piece is knocked out of their hands). If both miss, they come to their cutlasses, and then he is declared the victor who draws the first blood.)

(This means that the crew members were not allowed to fight on the ship. If they had to fight, they would fight on shore.  They would start with a duel where both pirates tried to shoot each other.  If both of them missed, they would fight with their swords. They were not allowed any help from other crew members in their fight.)

IX. No man to talk of breaking up their way of living, till each had shared one thousand pounds. If in order to this, any man should lose a limb, or become a cripple in their service, he was to have eight hundred dollars, out of the public stock, and for lesser hurts, proportionately.

(This means that no crew member was allowed to leave the ship's crew until each member had 1000 pounds' share of plunder (stolen money or goods). If a crew member became seriously injured, he would be given 800 dollars.)

X. The captain and quartermaster to receive two shares of a prize: the master, boatswain, and gunner, one share and a half, and other officers one and quarter.

(The captain and the quartermaster each receive two shares of stolen money or goods (double what the regular pirates got). The master, boatswain, and gunner each receive one and a half shares of stolen money or goods. Other officers receive one and one fourth shares of stolen money or goods.)

XI. The musicians to have rest on the Sabbath Day, but the other six days and nights, none without special favour.

(Musicians could not play music on the Sabbath Day.)

Captain John Phillips's articles 
Captain John Phillips, captain of the Revenge, also set a code for his men in 1724:

I.   Every Man Shall obey civil Command; the Captain shall have one full Share and a half of all Prizes; the Master, Carpenter, Boatswain and Gunner shall have one Share and quarter.

(Every pirate had to obey the rules and orders of the Captain and other people in charge.  The Captain would get one and a half shares of any stolen money or goods.  The Master, Carpenter, Boatswain, and Gunner would get one and a quarter shares.)

II.   If any Man shall offer to run away, or keep any Secret from the Company, he shall be marooned with one Bottle of Powder, one Bottle of Water, one small Arm, and Shot.

(If any pirate talked about running away from the ship, or kept any secret from the group, he would be marooned.  A pirate who was marooned by Captain Phillips would be left on a deserted island with one bottle of water, a small gun, a bottle of gunpowder and one bullet, so he could shoot and kill himself if he wanted to.)

III.  If any Man shall steal any Thing in the Company, or game, to the Value of a Piece of Eight, he shall be marooned or shot.

(If a pirate stole anything from the ship that was worth more than a piece of eight (a Spanish dollar), he would be marooned or killed.)

IV.  If any time we shall meet another Marooner that Man shall sign his Articles without the Consent of our Company, shall suffer such Punishment as the Captain and Company shall think fit.

V.   That Man that shall strike another whilst these Articles are in force, shall receive Moses’s Law (that is, 40 Stripes lacking one) on the bare Back.

(A pirate who hit another pirate would be whipped 39 times on his bare back.)

VI.   That Man that shall snap his Arms, or smoke Tobacco in the Hold, without a Cap to his Pipe, or carry a Candle lighted without a Lanthorn, shall suffer the same Punishment as in the former Article.

(A pirate that fired a gun when not in battle, smoked tobacco in the hold (where gunpowder was kept), or carried a candle that was not in a lantern, would be whipped 39 times on the bare back.  These things were dangerous because they could start fires on the ship or make the gunpowder on the ship explode.)

VII.  That Man shall not keep his Arms clean, fit for an Engagement, or neglect his Business, shall be cut off from his Share, and suffer such other Punishment as the Captain and the Company shall think fit.

(If a pirate did not keep his weapons clean and ready for battle, or did not do his job, he would not get a share of any stolen money or goods.  He could also be punished in any other way that the Captain and other pirates decided.)

VIII.  If any Man shall lose a Joint in time of an Engagement, shall have 400 Pieces of Eight ; if a Limb, 800.

(A pirate who lost a joint in battle would be given 400 pieces of eight.  A pirate who lost an arm or a leg would be given 800 pieces of eight.)

IX.    If at any time you meet with a prudent Woman, that Man that offers to meddle with her, without her Consent, shall suffer present Death.

(Any pirate that tried to rape a woman would be killed.)

Articles of Edward Low and George Lowther
The Boston News-Letter, an old newspaper published in the 1700s, printed these rules and said they were set by Captain Edward Low.  The first eight of these articles are basically the same as the rules that Charles Johnson's book says Captain George Lowther used.  Since Lowther and Low are known to have sailed together from about January 1, 1722 to May 28, 1722, Low and Lowther probably did use the same articles. Low's two extra articles were probably ordinance, or amendment, adopted after the two crews separated.

I. The Captain is to have two full Shares; the [quarter] Master is to have one Share and one Half; The Doctor, Mate, Gunner and Boatswain, one Share and one Quarter.

II. He that shall be found guilty of taking up any Unlawful Weapon on Board the Privateer or any other prize by us taken, so as to Strike or Abuse one another in any regard, shall suffer what Punishment the Captain and the Majority of the Company shall see fit.

(A pirate who was found guilty of taking a weapon onto the ship with the goal of hurting another pirate would be punished.  The punishment would be voted on by the pirates, and would be whatever the Captain and most of the pirates decided.)

III. He that shall be found Guilty of Cowardice in the time of engagements, shall suffer what Punishment the Captain and the Majority of the Company shall think fit.

(A pirate who was found guilty of being a coward - not being brave enough - during battle would be punished however the Captain and most of the other pirates decided.)

IV. If any Gold, Jewels, Silver, &c. be found on Board of any Prize or Prizes to the value of a Piece of Eight, & the finder do not deliver it to the Quarter Master in the space of 24 hours he shall suffer what Punishment the Captain and the Majority of the Company shall think fit.

(If a pirate had any stolen money or goods that were worth more than a piece of eight, he had to give it to the Quarter-Master within 24 hours.  If he did not, he would be punished however the Captain and most of the other pirates decided.)

V. He that is found Guilty of Gaming, or Defrauding one another to the value of a Royal of Plate, shall suffer what Punishment the Captain and the Majority of the Company shall think fit.

(If a pirate was found guilty of gambling for money, or stealing money from another pirate, he would be punished however the Captain and most of the other pirates decided.)

VI. He that shall have the Misfortune to loose a Limb in time of Engagement, shall have the Sum of Six hundred pieces of Eight, and remain aboard as long as he shall think fit.

(If a pirate lost an arm or a leg during battle, he would be given 600 pieces of eight.  The pirate could decide whether to stay on the ship or leave.)

VII. Good Quarters to be given when Craved.

VIII. He that sees a Sail first, shall have the best Pistol or Small Arm aboard of her.

(The first pirate to see a ship that the pirates could attack would be given the best gun the pirates were able to steal from that ship.)

IX. He that shall be guilty of Drunkenness in time of Engagement shall suffer what Punishment the Captain and Majority of the Company shall think fit.

(A pirate who was drunk during a battle would be punished however the Captain and most of the other pirates decided.)

X. No snapping of Guns in the Hold.

Pirate Code of Pirates of the Caribbean
In the Disney movie trilogy Pirates of the Caribbean, all the featured pirates are governed by a single Code.  While the Code has the force of law in Shipwreck Cove, where a codex containing the complete code is kept under the care of Captain Teague, elsewhere, the Code is treated more as a set of guidelines than as actual rules.

Related pages
 Piracy in the Caribbean

References 
 Really Bad Eggs: Pirates of the Caribbean
 Pirate Articles of Capt. John Phillips 1724 
 Charles Johnson, A General History of the Robberies and Murders of the Most Notorious Pyrates, London, 1724.
 Benerson Little, The Sea Rover's Practice: Pirate Tactics and Techniques, 1630-1730. Potomac Books, 2005.

Piracy
Ethics