This is one of the phrases where the honest ending is that nobody knows. Not "the experts lean toward one", and not "the most likely explanation is". Phrase Finder lists five separate origin theories, examines them, and closes with the words "pay nothing and take your choice."
That is a real answer, and on a SERP where every other page picks a winner it is the more useful one. The reason this site publishes it that way is set out in the method behind these origin pages: a page that manufactures certainty is worth less than a page that shows you the state of the evidence.
The citation trail
Phrase Finder gives the earliest citation as 1602, in Thomas Dekker's The Untrussing of the Humorous Poet: "thou art in thy Pee and Kue: thou hast such a villanous broad back."
Read that line and the difficulty becomes obvious immediately. It is not about minding anything. It is not about manners, letters, drinks or dancing. Somebody is described as being "in" his pee and kue, and it is followed by a remark about the width of his back, which reads as being about clothing.
So the earliest appearance of the words does not obviously belong to any of the five stories, and it may not even be the same expression. An early citation that does not fit the modern sense is a warning that the phrase may have more than one history braided together, and that is a fair description of where this one stands. We quote the line as Phrase Finder gives it and have not opened the play.

The five theories
Phrase Finder sets out five. Here is what each rests on.
Pints and quarts. A publican chalking up a customer's drinks needed to distinguish pints from quarts, and telling a drinker to mind his Ps and Qs meant watching the tally. It has the great advantage of explaining why the two letters travel as a pair, and the great disadvantage that nobody has produced a tally board or a text describing the practice.
Printer's type. In a case of movable type, a lowercase p and a lowercase q are mirror images, and a compositor picking the wrong one produced an expensive error. A variant of this aims the advice at children learning to write rather than at printers.
Pea jackets and queues. Sailors' coats and the fashionable tied wig. This one at least offers a reason for the Dekker line's interest in a broad back, since it is about dress.
French dancing instruction. From pieds and queues, feet and the tails of a coat or wig, as a dancing master's correction.
Pleases and thank-yous. The manners reading, which is by far the most common explanation offered to children today, and which works as an initialism only if you already know the answer you are looking for.

Where Phrase Finder lands, and how to read it
Phrase Finder does not choose. Its author does record a personal preference for the handwriting version, on the reasoning that handmade paper was expensive and typesetting was slow, so care with letters mattered in a way it no longer does.
That is a preference and this page reports it as one. A named writer saying which theory he finds most plausible is a different kind of statement from a reference reporting a documented fact, and the two get flattened into each other constantly. Half the confident origin stories in circulation began life as somebody's clearly labeled hunch and lost the label somewhere in the third or fourth retelling.

Why five theories is itself the finding
There is a pattern worth naming here, and it also explains "the whole nine yards" and the theories piled around "raining cats and dogs".
When a phrase has one documented origin, you get one story. When a phrase has no documented origin, you get many, because each generation supplies an explanation from whatever was familiar to it, and none of them can be eliminated because none of them was ever the source. The number of competing theories is close to a direct measure of how little is known.
So the correct reading of "five theories" is not "somewhere in here is the answer." It is "this is what an unsolved phrase looks like." All five are back-formations: someone met the phrase, found it opaque, and reasoned backwards to a scene that would produce it.

The apostrophe question
A small practical matter, since it is what a lot of readers actually came for.
Both "Ps and Qs" and "P's and Q's" are in use, and neither is an error. The apostrophe here marks a plural of a letter rather than a possessive, which is one of the very few places where an apostrophe before a plural s is defensible in modern English. Style guides split on it. If you have a house style, follow it. If you do not, pick one and be consistent, which is the only rule that matters in a case where the authorities disagree.

Register and region
| Register | Region | Status | |
|---|---|---|---|
| mind your Ps and Qs | casual to neutral, and slightly old-fashioned. Often said to children | both US and UK, more common in UK usage | current but fading |

What is genuinely unresolved
Everything about the origin. Five theories, none documented, and a reference that declines to pick.
Whether the 1602 Dekker line is even the same expression. Its sense does not match the modern one and may point at clothing rather than at care.
What the OED says. Our map row records that the OED calls the origin uncertain. We did not load the OED for this page, so that claim is not repeated as ours, and it should be checked before anyone cites it.




