🧠 Trivia Quiz Generator

Test your knowledge with random trivia questions. Choose category, difficulty, and question count. Powered by Open Trivia DB. Free — no signup.

Free No Signup Required Browser-Based Live Data
🧠

Ready to Test Your Knowledge?

Answer 10 random trivia questions across science, history, technology, and geography.

What Trivia Quiz Generator Does

This quiz pulls ten multiple-choice questions at random from the Open Trivia Database, across all 24 of its categories, and scores you as you go.

Every question is community-submitted and moderated before publication. That is worth knowing because it explains both the strength and the weakness of free trivia data: the catalogue is broad and free, and the correctness of any single question rests on a volunteer reviewer rather than an editorial process.

The database is smaller than it appears from the inside. Measured on 11 September 2026 it held 5,298 verified questions — and 10,911 further questions awaiting review, a backlog more than twice the size of what is actually served.

How to Use Trivia Quiz Generator

  1. Select a category and difficulty level
  2. Choose the number of questions
  3. Click "Start Quiz" to begin
  4. Answer each question and see your score

Formula Used by Trivia Quiz Generator

What a guess is worth, and what a score means

expected score = questions × (1 ÷ options)

questions
10 per round
options
4 — this quiz requests multiple-choice only, never true/false

Worked example

Pure guessing, and the alternative of a true/false round.

  1. Multiple choice: 10 × (1 ÷ 4) = 2.5 expected
  2. True/false: 10 × (1 ÷ 2) = 5.0 expected

Result: Scoring 5 out of 10 here is genuine knowledge; scoring 5 out of 10 on a true/false quiz is exactly what a coin achieves. This quiz requests type=multiple for that reason — a true/false round cannot distinguish a player from a coin.

Why option order has to be shuffled properly

Array.prototype.sort() with no comparator sorts by string, not at random

no comparator
Elements are coerced to strings and compared lexicographically
lexicographic
"10" sorts before "2", because "1" precedes "2"

Worked example

A question whose four answers are the numbers 2, 4, 10 and 30.

  1. Intended: a random order, or failing that a numeric one
  2. Actual with a bare .sort(): ["10", "2", "30", "4"]

Result: Numeric answers rendered in an order that looks broken, and every question presented in a fixed alphabetical sequence rather than a shuffled one. Replaced with Fisher-Yates, which produces a genuinely uniform order — the same fix the flag quiz on this site needed.

Open Trivia Database, Measured

From the api_count_global and api_category endpoints on 11 September 2026.

MeasureValue
Verified questions served5,298
Questions pending review10,911
Categories24
Difficulty levels3 — easy, medium, hard
Question types2 — multiple choice and true/false

What the Response Code Means

OpenTDB returns a response_code in the body. A wrapper that only checks the HTTP status will misread several of these as success.

CodeMeaning
0Success — questions returned
1No results: the database has fewer questions than requested for those filters
2Invalid parameter
3Session token not found
4Session token exhausted — every question for that token has been returned

Why a Round Sometimes Repeats Itself

Three distinct causes, which look identical unless the tool distinguishes them.

CauseWhat you see
Rate limitedOpenTDB allows roughly one request every five seconds per address and answers 429
API unreachableNetwork failure or timeout
Random overlapTen questions drawn at random from 5,298 will occasionally repeat one you have seen

How to Read Your Result

The moderation backlog is the real story about free trivia data

Twice as many questions sit pending review as are actually published. That backlog is the quality control working — submissions are held until a volunteer checks them — and it is also the reason the catalogue grows slowly. The practical consequence for a player is that a served question has been looked at by someone, which is better than most free trivia sources manage, and is still not the same as editorial verification. If an answer looks wrong to you, it may well be, and the database has a reporting mechanism for exactly that.

A silent fallback is worse than a visible failure

OpenTDB rate limits hard — a second request within a few seconds returns 429. The obvious way to handle that is a local bank of questions, and the obvious mistake is serving it without saying so. This tool holds exactly ten stored questions, so a fallback round is always the same ten in a different order, and a player who pressed "Play Again" too quickly previously got that with no indication anything had changed. The round now says plainly when it is stored rather than live, and why. A tool that quietly substitutes local data for remote data teaches its user to trust something that is not there.

Multiple choice is the only format that measures anything

With two options, a coin scores 50%. With four, random guessing averages 25%, so the gap between guessing and knowing is wide enough to mean something over ten questions. It is a small design decision with a real effect on whether a score is informative, and it is the reason this quiz requests type=multiple rather than accepting whatever mix the API would otherwise return. The same logic applies to reading any quiz result: ask how many options there were before deciding whether a percentage is impressive.

HTML entities are the standard trap in this API

OpenTDB's questions contain quotation marks, ampersands and accented characters, and by default it returns them HTML-encoded — so a question about a film arrives containing " and &. Wrappers that render the string directly show the raw entities; wrappers that decode by assigning the response to innerHTML push a remote string through an HTML parser to do it. The API offers encode=url3986, which sidesteps both by returning percent-encoded text that decodeURIComponent handles. This tool uses it.

Limitations & Accuracy Notes

  • A wrapper over the Open Trivia Database. No questions are written here and question quality is entirely theirs.
  • Questions are community-submitted and volunteer-moderated, not editorially verified. Errors do occur.
  • Ten questions per round, drawn randomly across all categories and difficulties. There is no category filter, no difficulty setting and no timer.
  • OpenTDB rate limits to roughly one request every five seconds. Starting rounds in quick succession will hit it.
  • When the API is unavailable the quiz serves ten stored questions — always the same ten — and labels the round as stored rather than live.
  • No session token is used, so the same question can recur across rounds.
  • English only, and no score history, leaderboard or account.

Frequently Asked Questions

What trivia categories are available?
Categories include General Knowledge, Science, History, Geography, Entertainment, Sports, Art, Animals, and many more — over 20 categories.
How does the scoring system work?
Each correct answer adds 1 point to your score. You receive instant visual feedback after each question and a final score summary upon completion.
Where do the questions come from?
The Open Trivia Database, where questions are community-submitted and moderated by volunteers before publication. Measured on 11 September 2026 it served 5,298 verified questions and held 10,911 more awaiting review.
Are the answers reliable?
Moderated, not editorially fact-checked — which is better than most free trivia sources and is not the same as verified. Errors do occur, and the database has a reporting mechanism for them.
Why did I get the same ten questions again?
That happens when OpenTDB is unreachable or has rate-limited you, in which case the quiz falls back to ten stored questions and says so on screen. It limits requests to roughly one every five seconds, so starting rounds quickly will trigger it.
Why multiple choice rather than true/false?
Because with two options a coin scores 50%. With four, guessing averages 25%, so the gap between guessing and knowing is wide enough for a score out of ten to mean something.
Can I pick a category or difficulty?
Not currently — each round draws at random across all 24 categories and all three difficulty levels, so rounds vary considerably in how hard they are.
Is my score saved?
No. There is no account and no history; the score exists for the round you are playing.

References & Further Reading

By OnlineToolHubs Team • September 2026