1729, "jester, merry fellow, one who jokes," agent noun from joke (v.). In generic slang use for "any man, fellow, chap" by 1811, which probably is the source of the meaning "odd face card in the deck" (1868), also often jolly joker. An 1857 edition of Hoyle's "Games" lists a card game called Black Joke in which all face cards were called jokers.
American manufacturers of playing-cards are wont to include a blank card at the top of the pack; and it is, alas! true that some thrifty person suggested that the card should not be wasted. This was the origin of the joker. ["St. James's Gazette," 1894]