Mafia Role Generator Online
The Mafia Role Generator by Relev3n helps you run a fair and exciting Mafia game. Roles are assigned secretly, one player at a time, preventing cheating and confusion.
🎮 How to Play
Set the number of players and the roles you want: Mafia, Doctor and Detective. Everyone else becomes a Villager. Each player reveals their role privately on the device, hides it again, and passes the phone to the next player.
✨ Features
- Customizable roles and player count
- Tap-to-reveal secure role cards
- A recovery PIN for every player
- Perfect for real-world Mafia nights
Game Setup
Optional. If you add an email, the roles and PINs are sent to it through the EmailJS service when the game ends. Leave it blank and nothing is sent. The narrator does not get a role, so count only the players.
🎭 Roles Assigned
All players have viewed their roles.
Hand the phone to the moderator.
Game ID:
Forgot your role?
What is this Mafia role generator?
Mafia is a party game of bluffing and guessing. A few players secretly belong to the Mafia. Everyone else is trying to work out who they are before the Mafia take over the town. For the game to work, nobody can know anyone else’s role, and that usually means handing out paper cards or folded slips.
This page does that job on a single phone. You enter the number of players and the roles you want, then pass the phone around the circle. Each person taps the card to see their role and taps again to hide it. The roles are shuffled randomly every game, so nobody, including the person running the game, knows who has what until the end.
The tool deals the roles only. It does not run the night and day rounds. One person acts as the narrator and runs those, as described below.
At a glance
Players: 3 to 40, plus a narrator.
Devices: one phone, passed around.
Roles: Mafia, Doctor, Detective, Villager.
Cost: free, no account.
What each role does
Mafia
Knows who the other Mafia are. At night they silently pick one player to eliminate. In the day they blend in and try not to be voted out.
Doctor
Each night, picks one player to protect. If the Mafia choose the same player, that player survives the night.
Detective
Each night, points at one player. The narrator silently tells them whether that player is Mafia or not.
Villager
Has no special power. Villagers win by talking, watching and voting out the Mafia during the day.
Narrator
Runs the game, wakes each role at night and announces what happened. The narrator does not play and does not need a card.
How a round works
Once everyone has seen their role, the narrator takes the phone and runs the game in rounds.
Night
Everyone closes their eyes. The narrator wakes the Mafia, who silently choose a victim. Then the Doctor picks someone to save, and the Detective points at a suspect. Everyone goes back to sleep.
Day
Everyone wakes up. The narrator says who was eliminated in the night, or that nobody was if the Doctor saved the victim. The group then talks, accuses and defends.
Vote
The players vote to eliminate one suspect. The eliminated player is out of the game. Play continues until one side wins.
How to win. The townspeople win when every Mafia player has been eliminated. The Mafia win when there are as many of them as townspeople left, because they can then outvote everyone else.
How many of each role?
These are starting points. Adjust them to suit your group and how long you want the game to last.
5 to 7 players
1 Mafia, 1 Doctor, 1 Detective, and the rest Villagers. A small game that finishes quickly.
8 to 11 players
2 Mafia, 1 Doctor, 1 Detective, and the rest Villagers. This is the classic party size.
12 to 17 players
3 Mafia, 1 or 2 Doctors, 1 Detective, and the rest Villagers. Add a second Doctor if games feel too deadly.
18 or more
4 or more Mafia, 2 Doctors, 2 Detectives. A good rule of thumb is about one Mafia for every four or five players.
Tips for the narrator and the group
Count only the players. The narrator does not get a role, so leave them out of the “Total Players” number. If you enter 8, the tool deals 8 roles.
Hide the card every time. After you read your role, tap the card again before you pass the phone. Pressing Next Player also hides it right away.
Keep your face still. Half of Mafia is bluffing. Look at your card quickly and keep the same expression whatever the role is.
Write down your PIN only if you need it. Every player is shown a 4-digit recovery PIN. If someone forgets their role, the narrator enters their player number and PIN on the last screen to show it again privately.
Do not refresh the page mid-game. The roles and PINs are held only on the page while the game runs. If you refresh, close the tab or lock the phone for long enough that the browser reloads it, they are lost and you need to start a new game. Adding a narrator email is one way to keep a copy.
Use a steady night routine. Say the same words each night, such as “Mafia, open your eyes”, and tap the table softly for sleeping. Consistent timing stops people from guessing who has a role.
History of the Mafia Game
The Mafia game is a social deduction party game created in 1986 by Dmitry Davidoff, a psychology student at Moscow State University. It is often described as an experiment in how people behave in situations involving hidden information, persuasion, and group decision-making.
The game explores deception, persuasion, and collective decision-making. Players are divided into two groups — the Mafia and the Townspeople. In its earliest form, the game divided players into two main groups: the Mafia, who secretly knew each other, and the Innocent Townspeople, who did not. During the game, players would discuss, argue, and vote to eliminate suspected Mafia members, while the Mafia would secretly eliminate townspeople at night. The tension between deception and logic made the game highly engaging.
Global Popularity
Mafia spread rapidly through universities worldwide and inspired variants such as Werewolf.
After its creation, Mafia quickly spread across universities and student communities in Russia and Eastern Europe. Because it required no equipment and could be played by large groups, it became especially popular in social gatherings, dormitories, and parties. In the 1990s, the game expanded internationally and gained different names and variations. One of the most well-known adaptations is “Werewolf”, which uses a similar concept but replaces the Mafia members with werewolves. Despite theme changes, the core gameplay remains the same.
Evolution of the Game
Over time, new roles were added to make the game more strategic and exciting. These roles include:
- Doctor – can save a player from elimination
- Detective – can investigate players’ identities
- Narrator / Moderator – manages the game flow
Modern Mafia
Modern versions of Mafia often include many custom roles, rule variations, and time-based rounds, making each game unique.
Today, Mafia is played both offline and online, using digital tools that automate
role distribution and gameplay.
Quick answers
Do all players share one phone?
Yes. Each player taps the card to see their role, taps again to hide it, then passes the phone to the next player. After the last player, the phone goes to the narrator.
How many players do I need?
At least three, though Mafia is far better with six or more. The tool accepts up to 40 players. You also need one extra person to act as narrator.
Does the narrator get a role?
No. The narrator runs the game and does not play, so leave them out of the player count.
Are the roles really random?
Yes. The roles are shuffled with a fair shuffle each time you press Start Game, and nobody sees the result until their own turn.
What is the recovery PIN?
Each player gets a 4-digit PIN with their role. If someone forgets their role, the narrator can enter the player number and PIN on the final screen to show it again privately.
What does the narrator’s email do?
It is optional. If you add one, a summary with every role and PIN is sent to that address through the EmailJS service when the game is dealt. Leave it blank and nothing is sent.
What happens if I refresh the page?
The game is lost. Roles are kept only in the open page and are not saved anywhere, so a refresh means starting a new game.
Why do I hear a sound at the end?
A short notification sound plays when the last player reveals their role, so the narrator knows everyone has seen theirs. It plays only if your browser allows sound.
Can I play Werewolf with it?
Yes. Werewolf follows the same structure. Use “Mafia” for the werewolves, “Doctor” for a healer role, and “Detective” for a seer.
Want more games?
Try Housie, Spin the Bottle, X & O, Memory Match and more, all free on Relev3n.
Explore all games