A short time after the war of 1812, Elbert Anderson, of Troy, New York, a contractor for the army, went to Troy to purchase some provisions. It was Anderson's habit to stamp all boxes containing goods with his initials and those of the United States, thus— "E. A." and "U. S." One of the inspectors, an old man, popular for his wit and humor, was named Samuel Wilson, familiarly known as Uncle Sam.
One day a new man in the office asked what the letters on the boxes stood for, and an employee, thinking to tease Uncle Sam, replied: "E. A. for Elbert Anderson who contracts for the supplies, and U. S. for Uncle Sam who inspects them."
The joke spread and ere long the letters, "U. S." became generally applied to the name Uncle Sam. Some cartoonist, looking for a popular figure to impersonate the United States, hearing the story, used the characteristic Uncle Sam of the inspecting room dolled up in flag-like clothes.