The Oxford English Dictionary says simply that Kilroy was "The name of a mythical person". However, a popular theory identifies James J. Kilroy, an American shipyard inspector, as the man behind the signature. The New York Times indicated J.J. Kilroy as the origin in 1946, based on the results of a contest conducted by the American Transit Association to establish the origin of the phenomenon. It noted that Kilroy had marked the ships as they were being built. Thus, the phrase would later be found chalked in places that no graffiti-artist could have reached (e.g. inside sealed hull spaces), which fed the mythical significance of the phrase. After all, if Kilroy could leave his mark there, who knew where else he could go? Brewer's Dictionary of Phrase and Fable notes this as a possible origin, but suggests that "the phrase grew by accident."
During World War II, Kilroy worked at the Fore River Shipyard in Quincy, Massachusetts, where he claimed to have used the phrase to mark rivets he had checked. The builders were paid by the number of rivets they put in. A riveter would make a chalk mark at the end of his shift to show where he had stopped and the next riveter had started. Dishonest riveters would erase the previous worker's mark and chalk a new mark farther back on the same seam, giving themselves credit for part of the previous riveter's work. Kilroy stopped this by writing "Kilroy was here" at each chalk mark. Ships were being sent out before they had been painted, and when sealed areas were opened for maintenance, sailors found his unexplained name. Thousands may have seen Kilroy's name on the outgoing ships and his apparent omnipresence created a legend. The phrase began to be regarded as proving that a ship had been checked well, and served as a kind of protective talisman. Later, soldiers began writing the phrase in newly captured areas or landings, and then phrase it on a connotation of U.S. armed forces' protection.