The phrase to a T, or to a tee, means with minute exactness.
It is first recorded in The Humours, and Conversations of the Town, Expos’d in Two Dialogues, The First, of the Men, The Second, of the Women (London, 1693), probably by James Wright (1643-1713), antiquary and miscellaneous writer:
As for your Country Attorney, he’s no less than my Lord Chancellour on a Market-day in a Country Town, where at the best Inn he takes up his standing, whilst all the under Villages and Towns-men come to him for Redress; which he does to a T. for he never is an Arbitrator, but he improves the Cause into a Suit of Law, setting all Parties together by the ears, to make up his own Market.
Elkanah Settle (1648-1724), English poet and playwright, also used the phrase in The compleat memoirs of the life of that notorious impostor Will. Morrell, alias Bowyer, alias Wickham, &c. Who died at Mr. Cullen’s the bakers in the strand, Jan. 3. 1691/2. With considerable additions never before published (London, 1694):
He Equips himself with a Sturdy Young Country-Fellow, a Ralpho to our Hudibras, and takes a Knight-Errantry one day to a Fair at Brayls in Warwick-shire, his Habit between a Grazier and a plain Country-Gentleman; where Santering about with his Man Tom (for so his Squire was titled) at last spying a Knot of good likely Kine (near a Score of them.) Ah Master, says Tom, what a parcel of brave Cattle are these. Ay Tom, replies the Master, I am sorry I saw them no sooner; these would do my business to a T; but as the Devil and ill Luck would have it, I have laid out my whole Stock already, and so I’ll e’en set my Heart at Rest.
This phrase is probably a shortening of to a tittle (tittle meaning, literally, a small mark used in writing or printing), used in exactly the same sense and constructions, and first recorded in The Woman Hater (London, 1607), by Francis Beaumont (1584-1616) and John Fletcher (1579-1625):
Enter two Intelligencers, discouering treason in the Courtiers words.
1. Intelligencer. There take your standing, be close and vigilāt, here will I set my selfe, and let him looke to his language, a shal know the Duke ha’s more eares in Court than two.
2. Intelligencer. Ile quote [= observe] him to a tittle, let him speake wisely, and plainely, and as hidden as a can, or I shall crush him.
It has been suggested that to a T refers to T square, denoting a T-shaped instrument used by mechanics and draughtsmen for drawing lines parallel, or at right angles, to each other. But T square is attested in 1785 only, nearly a century after the phrase.
According to another theory, the phrase alludes to tee, a noun of unknown origin first recorded around 1646 in the form teaz, denoting first a cleared space on a golf course, from which the ball is struck at the beginning of play for each hole, and later also a small peg placed in the ground to support a golf ball. But, although the sense starting-point of tee could had developed into the sense with exact minuteness of the phrase, the earliest occurrences of the latter are to the T, not to the tee, and are not remotely related to golf.
It has also been suggested that the phrase originally referred to the proper completion of the letter t by crossing it. But the phrase to cross the t’s first appeared in to cross the t’s and dot the i’s, itself attested in 1849 only.