Are there any examples of actual jokes in tanach? Please provide sources.
In the Haftorah of Parshas Ki Sisa (Malachim Aleph 18:20-39) when Eliyahu is on Har HaCarmel and he is waiting for the priests of Baal, he watches them as they pray to their god to rain fire upon their sacrifice. When none is forthcoming, Eliyahu tells them (verse 27) to "Call with a loud voice, for he is a god. [Perhaps] he is talking or he is pursuing [enemies] or he is on a journey; perhaps he is sleeping and will awaken". I have always been under the impression that Eliyahu was poking fun at them rather than suggesting a real option. So perhaps Eliyahu we see at least had a sense of humor. (Although I'll wager that the priests of Baal didnt find it half as funny!!!)
There is an excellent book by Yehuda Radday and Athalya Brenner, entitled On Humor and the Comic in the Hebrew Bible (JSOTS Series; Continuum International Publishing Group, 1990). I don't have a copy on hand, so I cannot provide you with the relevant page numbers, but the sorts of issues that they explore are whether or not, and to what extent, Jonah is a parody and Esther is a parody, whether or not there is scatological humour in such passages as Ehud's assassination of the fat Moabite king, and so on. For passages within the Torah in particular, I seem to remember them mentioning situational humour (such as when Pharaoh's magicians demonstrate their prowess by making the plagues worse), and puns. That last one is important, since it underscores the fact that humour isn't necessarily that which makes you laugh.
To my mind, the most beautiful example is one found outside of the Torah, in the book of Samuel. When we meet Saul, we are told that he is exceptionally handsome and very tall. On his way to find the seer, Samuel, he encounters a group of young girls drawing water from a well. (Almost every book I've ever seen on the Hebrew Bible as literature mentions the trope of 'boy meets girl at well'). When Saul asks them about the location of the seer, they respond with the most syntactically awkward conglomeration of phrases, anticipating and repeating one another in confusion. Rather than suppose that we are looking at a corrupted text (as some have, historically, supposed), it makes greater sense to suggest that the author is representing the sound of a group of young girls speaking over one another in order to answer the handsome stranger.
For the Torah in particular, one of my favourite examples (and one not mentioned in Radday and Brenner's book) is the response of Cain to his punishment. He is already singled out as being arrogant (his statement in 4:13 can be read as both an expression of anguish and a rhetorical question: "Is my crime too great to be forgiven!?"), so it is unsurprising that after being condemned to a life of vagrancy he goes and settles himself elsewhere and founds a city.
The specific punishment that God gave him was that he be "נע ונד" (a wanderer and a vagabond) upon the earth - 4:12. Both of those words are participles, which means that they can be read as verbs (wander, move back and forth) or as nouns (one who wanders, etc). The land in which Cain settles himself after receiving this punishment is Nod - formed off the participle of נד! In other words, it would be like somebody being told they must be "a wanderer", so settling in a land called "Wander".
As to whether or not these are viable examples, and as to whether or not they reside in the minds of interpreters, you should look at Radday and Brenner's book. There is good evidence either way, and anybody who wishes to treat the Bible as literature needs to consider the sorts of difficulties inherent in ascertaining genre and intent, given the length of time between its composition and today, the foreignness of the culture that produced it, and the fact that it is written in a language that is no longer spoken.
I was going to add a second answer, now that people are actually providing more in the way of specific examples, but I figured I'd add it to this one instead. This is an example of humour in Tanakh that I didn't mention - one that I personally find very funny, and which I think is continually mistranslated. It can be found in 1 Samuel 15:32-33, and constitutes the (rather grisly) execution of Agag, king of Amalek.
When Agag is brought before Samuel, his "famous last words" are to declare that, אכן סר מר המות. This is translated by JPS as "Ah, bitter death is at hand!" - although they note that the Hebrew is apparently uncertain. Artscroll, similarly, translates it as "Alas, the bitterness of death approaches", the NRSV has "Surely this is the bitterness of death", and so too several other translations.
Myself, I would read סר as a masc. sg. participle of סור ("turn aside"), its referent being מר המות. My translation, therefore, would render this as the hapless and ironic observation that "At least the bitterness of death has passed!" Agag, you couldn't be more wrong.
I know two:
יד וַיֹּאמֶר שְׁמוּאֵל, וּמֶה קוֹל-הַצֹּאן הַזֶּה בְּאָזְנָי, וְקוֹל הַבָּקָר, אֲשֶׁר אָנֹכִי שֹׁמֵעַ. 14 And Samuel said: 'What meaneth then this bleating of the sheep in mine ears, and the lowing of the oxen which I hear?'
Shemot 4:2: ב וַיֹּאמֶר אֵלָיו יְהוָה, מזה (מַה-זֶּה) בְיָדֶךָ; וַיֹּאמֶר, מַטֶּה. 2 And the LORD said unto him: 'What is that in thy hand?' And he said: 'A rod.'
I've always thought that Yosef was making a joke when interpreting the baker's dream. He tells the butler ישא פרעה את ראשך - Pharaoh will "lift up your head", meaning, restore him to his position. He then tells the baker ישא פרעה את ראשך מעליך - Pharaoh will "lift up your head" from on you, an unusual way of saying he'll be hanged. Because of the similarity in wording, Yosef might have been teasing the baker a bit.
The incident in Megillath Esther in which the king finds Haman pleading for his life to the queen and says, "What, and now you're trying to get at the queen while I'm still in the house?!" (my own, modernized, rough translation) can probably be seen as a bit of dark humor on the part of the king.
I think it is pretty clear at that point that the king had lost confidence in Haman and had decided to have him killed. I also think it was unlikely that he seriously suspected that Haman was trying to either attack or seduce Esther in that instance.
Most likely he was just in a (drunken) rage and made the quip that turned out to be very damning, perhaps even more so than he intended it.
Adding to Shimon's answer, we need to consider the virtue of Jewish kvetching. In Born to Kvetch, Yiddish expert Michael Wex asserts that a unique aspect of Jewish humor, the kvetch, roots in the Torah.
Regarding the nonstop grumbling of the Israelites:
They kvetch about their problems and they kvetch about the solutions. They kvetch in Egypt and they kvetch in the desert. No matter what God does, it's wrong; whatever favor He bestows, they're never enough.
So, for example, the Israelites are on the edge of the Red Sea, with Pharoah and his hosts closing fast behind them. God has been plaguing the Egyptians left and right and has just finished killing every one of their firstborn males. The Israelites are understandably nervous, but there's a big difference between being slightly apprehensive and insulting the agent of your deliverance: "And they said to Moses: 'What? There's no graves in Egypt, you had to take us into the desert to die. ...What did we tell you in Egypt? Get off our backs and let us serve the Egyptians, because serving the Egyptians is better than dying in the desert'" (Exod. 14:11-12).
This sort of thing constitutes what might be called the basic kvetch, the initial declaration of unhappiness that identifies the general area of complaint.
And then there's the counterkvetch:
The Jews want meat instead of the manna that they've been getting? Moses tells them: "God's going to give you meat and you're going to eat it. Not one day or two days; not five days or ten days or twenty days. But for a month you're going to eat it, until it's coming out of your noses" (Num. 11:19-20).
They get meat, all right--quails, hundreds and hundreds of quails--and for dessert they get a plague.
There are more examples in Wex's book, which centers around Yiddish language and culture. Hope that helps.
Just before the 2 angels destroyed Sodom, they asked Lot if he has family members to escape with him. See Bereshis 19:14
וַיֵּצֵא לוֹט וַיְדַבֵּר אֶל חֲתָנָיו לֹקְחֵי בְנֹתָיו וַיֹּאמֶר קוּמוּ צְּאוּ מִן הַמָּקוֹם הַזֶּה כִּי מַשְׁחִית יְהֹוָה אֶת הָעִיר וַיְהִי כִמְצַחֵק בְּעֵינֵי חֲתָנָיו:
So Lot went forth and spoke to his sons-in-law, the suitors of his daughters, and he said, "Arise, go forth from this place, for the Lord is destroying the city," but he seemed like a comedian in the eyes of his sons-in-law.
So if you picture the situation, you'd probably imagine those sons in law laughing their heads off at the thought that those 2 men (angels) would destroy those whole city just like that..
In 1 Samuel 21:15-16 Achish the King of Gath jokes that there was no need to bring David, who appeared as a madman to the kings presence. He quips: 'Am I short on crazy people that you need bring this guy to me?'
וַיֹּ֥אמֶר אָכִ֖ישׁ אֶל־עֲבָדָ֑יו הִנֵּ֤ה תִרְאוּ֙ אִ֣ישׁ מִשְׁתַּגֵּ֔עַ לָ֛מָּה תָּבִ֥יאוּ אֹת֖וֹ אֵלָֽי׃ טז חֲסַ֤ר מְשֻׁגָּעִים֙ אָ֔נִי כִּי־הֲבֵאתֶ֣ם אֶת־זֶ֔ה לְהִשְׁתַּגֵּ֖עַ עָלָ֑י הֲזֶ֖ה יָב֥וֹא אֶל־בֵּיתִֽי
I always thought the funniest joke in the Torah is coming right up in Vayera --- starting at Bereishit 19:30, with the punchline at verses 37-38. It seems to me that the story of Lot and his daughters was obviously a (pretty nasty and sick, actually) national joke for Israel/Judah, at the Ammonites' and Moabites' expense. Sure, we're all descendents of Terah, but YOU'RE ALL MAMZERS! Nice way to describe the origins of your neighbors...from the Mouth of G-d by the hand of Moshe! ...a good reason later on for Ammon and Moab to be tribute-paying subservient peoples, forbidden in the Temple in Devarim 23:4.
the Ten Plagues were a kind of joke as written (Exodus 10:2)
"and that you may tell in the hearing of your son, and of your grandson, how I made a mockery of the Egyptians and how I performed My signs among them, that you may know that I am the LORD"
Are there any jokes in tanach?
If sarcasm counts as humor;
Isaiah 44:13-17 The carpenter stretcheth out his rule; he marketh it out with a line; he fitteth it with planes, and he marketh it out with the compass, and maketh it after the figure of a man, according to the beauty of a man; that it may remain in the house. He heweth him down cedars, and taketh the cypress and the oak, which he strengtheneth for himself among the trees of the forest: he planteth an ash, and the rain doth nourish it. Then shall it be for a man to burn: for he will take thereof, and warm himself; yea, he kindleth it, and baketh bread; yea, he maketh a god, and worshippeth it; he maketh it a graven image, and falleth down thereto. He burneth part thereof in the fire; with part thereof he eateth flesh; he roasteth roast, and is satisfied: yea, he warmeth himself, and saith, Aha, I am warm, I have seen the fire: And the residue thereof he maketh a god, even his graven image: he falleth down unto it, and worshippeth it, and prayeth unto it, and saith, Deliver me; for thou art my god.
Elisha didn't tell jokes but at the start of Melachim II chapter 7, a certain guard of King Jehoram thought he was:
History is that there was famine as Israel had been laid siege by Aram.
And Elisha said: ‘Hear ye the word of the L-RD; thus saith the L-RD: To-morrow about this time shall a measure of fine flour be sold for a shekel, and two measures of barley for a shekel, in the gate of Samaria.’ 2 Then the captain on whose hand the king leaned answered the man of G-d, and said: ‘Behold, if the L-RD should make windows in heaven, might this thing be?’ And he said: ‘Behold, thou shalt see it with thine eyes, but shalt not eat thereof.’
This is from the haftarah we read for Parshat Metzora. They will not read it this year in Israel but we will outside of Israel.
I think that the answer that King Solomon gave to his mom with regard to his brother's request to obtain Abishag the Shunamite, speaks for itself about Shlomo's sense of humor, and sarcasm.
I Kings 2:21-22:
וַתֹּ֕אמֶר יֻתַּ֖ן אֶת־אֲבִישַׁ֣ג הַשֻּׁנַמִּ֑ית לַאֲדֹנִיָּ֥הוּ אָחִ֖יךָ לְאִשָּֽׁה׃ וַיַּעַן֩ הַמֶּ֨לֶךְ שְׁלֹמֹ֜ה וַיֹּ֣אמֶר לְאִמּ֗וֹ וְלָמָה֩ אַ֨תְּ שֹׁאֶ֜לֶת אֶת־אֲבִישַׁ֤ג הַשֻּׁנַמִּית֙ לַאֲדֹ֣נִיָּ֔הוּ וְשַֽׁאֲלִי־לוֹ֙ אֶת־הַמְּלוּכָ֔ה כִּ֛י ה֥וּא אָחִ֖י הַגָּד֣וֹל מִמֶּ֑נִּי וְלוֹ֙ וּלְאֶבְיָתָ֣ר הַכֹּהֵ֔ן וּלְיוֹאָ֖ב בֶּן־צְרוּיָֽה׃
And she said: ‘Let Abishag the Shunammite be given to Adonijah thy brother to wife.’ And king Solomon answered and said unto his mother: ‘And why dost thou ask Abishag the Shunammite for Adonijah? ask for him the kingdom also; for he is mine elder brother; even for him, and for Abiathar the priest, and for Joab the son of Zeruiah.’
Bereshit 11: men are building a BIG tower to reach heaven, Hashem hears about it and He has to come down to spot it, so minuscule it is.
Therefore, so says Hashem: you didn't listen to Me to declare freedom, each man to his brother and to his fellow; I hereby declare you free - says Hashem - for the sword, for the plague, and for the famine...
The insertion of "says Hashem" in the middle of a clause builds suspense for the "punch line."
If irony counts as humor, the Parshios of Yetzias Mitzrayim are full of irony. I have 2 verses corroborate what I'm saying:
The first verse is talking directly about the Exodus experience: אֲשֶׁר הִתְעַלַּלְתִּי בְּמִצְרַיִם That I made a mockery of Egypt Exodus 10:2
The 2nd verse is talking about Hashem's response to the nations that attack the Jews in the time of Mashiach, but I think it's fair to learn a parallel from it: יוֹשֵׁב בַּשָּׁמַיִם יִשְׂחָק אֲדֹנָי יִלְעַג לָמוֹ He Who dwells in Heaven laughs; the Lord mocks them. Tehillim 2:4
Now for the examples:
Pharaoh says to throw all the Israelite baby boys into the river in order to kill the future redeemer. Hashem causes Pharaoh to not only spare the one kid he's after, but actually adopt him and raise him as his own!
Pharaoh hurt the Jews through water in an attempt to outsmart God (see Rashi on "Hava nischakma lo"). His reasoning was that since Hashem promised never to bring another flood, He would be unable to punish him in a manner fitting the crime. Hashem says, sure, I won't bring a flood of water onto dry land - I'll cause you to run headlong into the sea and drown there!
There is reference to a joke in Bereishis:
In the beginning there was nothing, and God made light of it
for me the best example of a perceived joke, followed by laughter one is when Sarah laughs hearing G-d telling her she will have a child, paraphrasing her answer to G-d is "you've got to be kidding, at my age!"
כזוַיִּבְרָא אֱלֹהִים | אֶת הָאָדָם בְּצַלְמוֹ בְּצֶלֶם אֱלֹהִים בָּרָא אֹתוֹ זָכָר וּנְקֵבָה בָּרָא אֹתָם
27 And God created man in His image; in the image of God He created him; male and female He created them.
God must have a sense of humor. =)