In the second half of the 17th century, buccaneers 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 how much treasure each crew member would receive.

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

One of the most famous sets of pirate rules was written by the famous Welsh pirate Bartholomew Roberts in 1720.[1]

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.

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 with a sword and pistol. 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. 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. 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.

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.

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.

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.

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.

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.

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.

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

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.

The articles listed below are attributed by the Boston News-Letter to Captain Edward Low. The first eight of these articles are essentially identical to those attributed to pirate captain George Lowther by Charles Johnson. Since Lowther and Low are known to have sailed together from about New Year's to May 28, 1722, it is probable that both reports are correct and that Low and Lowther shared the same articles, with Low's two extra articles being an 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.

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.

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.

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.

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.

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.

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.

In the Disney movie trilogyPirates 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.