😂 Joke Generator

Get random jokes in multiple categories — programming, puns, dark humor, and more. Free joke generator powered by JokeAPI. No signup required.

Free No Signup Required Browser-Based Live Data

Requests are sent with JokeAPI's safe-mode and all six content flags blacklisted, and the response is checked for the safe marker before anything is shown.

What Joke Generator Does

This tool pulls a random joke from JokeAPI, filtered for safe content, in a chosen category. Jokes come back in one of two shapes: a single line, or a setup and a punchline that stays hidden until you ask for it.

Filtering here is stricter than it looks. JokeAPI defines six content flags — nsfw, religious, political, racist, sexist and explicit — and every request from this page blacklists all six and additionally sends safe-mode, the API's own stronger guarantee. The response carries a safe marker, which is checked before anything is displayed.

One consequence worth knowing up front: safe-mode narrows the catalogue sharply. JokeAPI holds 1,368 jokes across all languages and flags; 183 of them are English and marked safe. Expect repeats.

How to Use Joke Generator

  1. Select a joke category (or "Any")
  2. Click "Get Joke" to fetch a random joke
  3. Read and enjoy!
  4. Click again for another joke

Formula Used by Joke Generator

How quickly a 183-joke pool repeats

P(no repeat in n draws) = (1 − 1/N)(1 − 2/N) … (1 − (n−1)/N)

N
183 — English jokes passing safe-mode
n
Number of jokes drawn

Worked example

Independent random draws from the safe English pool.

  1. After 10 draws, the chance of having seen no repeat is 77.9%
  2. After 17 draws it is 46.5% — a repeat has become more likely than not
  3. After 30 draws it is 8.1%

Result: This is the birthday problem. Repeats arrive far sooner than a catalogue of 183 suggests: by the seventeenth press of the button, most people will already have seen the same joke twice. That is the pool being small, not the tool malfunctioning.

JokeAPI Catalogue, Measured

From the API's own /info endpoint on 11 September 2026, running version 2.3.3.

MeasureValue
Total jokes, all languages and flags1,368
English jokes passing safe-mode183
Categories7 — Any, Misc, Programming, Dark, Pun, Spooky, Christmas
Joke types2 — single, twopart

The Six Content Flags

JokeAPI's complete flag list. Every request from this page blacklists all six. A generator that blacklists a subset will serve the rest.

FlagWhat it marks
nsfwNot suitable for a workplace
religiousJokes about religion or religious figures
politicalJokes about politics or politicians
racistRacial content
sexistContent targeting a gender
explicitExplicit language or subject matter

Categories Offered Here

JokeAPI's Dark category is deliberately not offered on this page. Miscellaneous is an alias the API accepts for Misc.

CategoryContent
AnyDraws from every category this page offers
ProgrammingDeveloper and computing humor
PunWordplay
MiscellaneousGeneral jokes that fit nowhere else
SpookyHalloween and horror themed

How to Read Your Result

Blacklisting a subset of the flags is the common bug

JokeAPI accepts a blacklistFlags parameter listing which categories of content to exclude, and the failure mode is passing some of them. A generator that blacklists nsfw, racist, sexist and explicit but omits religious and political will happily serve religious and political jokes while presenting itself as filtered — which is precisely what this page did before it was fixed. safe-mode is the more robust control because it is a single switch maintained by the API rather than a list a developer has to keep complete, and the returned joke carries a safe marker that can be checked independently.

A two-part joke is structurally different, not just longer

The API returns type "single" with a joke field, or type "twopart" with separate setup and delivery fields. That distinction is the reason this page hides the punchline behind a button rather than printing both lines at once: the API has already told it where the joke breaks. A wrapper that concatenates the two fields and prints them together throws away the only piece of structure the format provides, and reading a setup and punchline simultaneously is a measurably worse way to encounter a joke.

When it fails, it fails with a 200

JokeAPI signals problems in the response body rather than the HTTP status — a request that matches nothing returns 200 with {"error": true, "code": 106}. A wrapper that checks only res.ok reads a joke field that does not exist, gets undefined, and renders an empty box with no explanation. This is a general pattern worth recognizing across free APIs: the status code and the body can disagree, and the body is usually the one telling the truth.

Limitations & Accuracy Notes

  • A wrapper over JokeAPI. Nothing here is written locally and the catalogue is entirely theirs.
  • Safe-mode restricts the English pool to 183 jokes, so repeats are frequent and expected.
  • English only. JokeAPI serves other languages but this page does not request them.
  • The Dark category is not offered here, and all six content flags are blacklisted, so a portion of the catalogue is unreachable from this page by design.
  • Filtering depends on JokeAPI's own flagging. A miscategorized joke will pass through, and no automated filter is a substitute for judgement about audience.
  • If the API is unreachable the page shows one stored joke, labeled as an offline fallback rather than presented as a fetch.
  • No search, no favorites, no history and no way to request a specific joke.

Frequently Asked Questions

What joke categories are available?
Categories include Programming, Puns, Miscellaneous, Spooky, and Christmas. You can also filter out specific types of humor.
Are jokes safe for work?
By default, we filter out NSFW, racist, sexist, and explicit jokes. All jokes shown are safe for general audiences.
Are the jokes filtered?
Yes, strictly. Every request blacklists all six of JokeAPI's content flags — nsfw, religious, political, racist, sexist and explicit — and additionally sends safe-mode. The response carries a safe marker which is checked before anything is displayed.
Why do I keep seeing the same jokes?
Because safe-mode narrows the pool sharply. JokeAPI holds 1,368 jokes across all languages and flags, of which 183 are English and pass safe-mode. By the seventeenth press of the button most people will already have seen a repeat.
Can I get jokes in another language?
Not from this page — it requests English only. JokeAPI does serve other languages, with far smaller safe pools.
Why is the punchline hidden?
Because the API tells us where the joke breaks — two-part jokes arrive with separate setup and delivery fields. Printing both at once throws away the only structure the format provides, and reading a punchline before the setup lands is a worse way to encounter a joke.
What happens if the API is down?
One stored joke is shown, labeled explicitly as an offline fallback rather than presented as a fresh fetch.
Is the dark category available?
No. It is deliberately not offered here, alongside blacklisting all six content flags.

References & Further Reading

  • JokeAPI v2 — documentationReference for the endpoint, the category list, the six content flags, safe-mode, and the single/twopart response types
  • JokeAPI — /info endpointSource of the measured catalogue figures above: 1,368 total jokes and 183 English jokes passing safe-mode, on version 2.3.3
By OnlineToolHubs Team • September 2026