The rules text from The Order of Combat in the SRD 5.1 (the 2014 rules), with the rules around it and the 2024 (SRD 5.2) text that goes with it.
A band of adventurers sneaks up on a bandit camp, springing from the trees to attack them. A gelatinous cube glides down a dungeon passage, unnoticed by the adventurers until the cube engulfs one of them. In these situations, one side of the battle gains surprise over the other.
The GM determines who might be surprised. If neither side tries to be stealthy, they automatically notice each other. Otherwise, the GM compares the Dexterity (Stealth) checks of anyone hiding with the passive Wisdom (Perception) score of each creature on the opposing side. Any character or monster that doesn't notice a threat is surprised at the start of the encounter.
If you're surprised, you can't move or take an action on your first turn of the combat, and you can't take a reaction until that turn ends. A member of a group can be surprised even if the other members aren't.
Initiative (from The Order of Combat)
Initiative determines the order of turns during combat. When combat starts, every participant makes a Dexterity check to determine their place in the initiative order. The GM makes one roll for an entire group of identical creatures, so each member of the group acts at the same time.
The GM ranks the combatants in order from the one with the highest Dexterity check total to the one with the lowest. This is the order (called the initiative order) in which they act during each round. The initiative order remains the same from round to round.
If a tie occurs, the GM decides the order among tied GM-controlled creatures, and the players decide the order among their tied characters. The GM can decide the order if the tie is between a monster and a player character. Optionally, the GM can have the tied characters and monsters each roll a d20 to determine the order, highest roll going first.
Combat Step by Step (from The Order of Combat)
Determine surprise. The GM determines whether anyone involved in the combat encounter is surprised.
Establish positions. The GM decides where all the characters and monsters are located. Given the adventurers' marching order or their stated positions in the room or other location, the GM figures out where the adversaries are/how far away and in what direction.
Roll initiative. Everyone involved in the combat encounter rolls initiative, determining the order of combatants' turns.
Take turns. Each participant in the battle takes a turn in initiative order.
Begin the next round. When everyone involved in the combat has had a turn, the round ends. Repeat step 4 until the fighting stops.
In the 2024 rules
The 2024 rules tie surprise to Initiative instead. Two of the SRD 5.2 conditions show it:
Invisible: If you're Invisible when you roll Initiative, you have Advantage on the roll.
Incapacitated: If you're Incapacitated when you roll Initiative, you have Disadvantage on the roll.
The 2024 Alert feat adds your Proficiency Bonus to Initiative and lets you swap Initiative with a willing ally.
How surprise works
Surprise is decided before anyone rolls initiative. If neither side is trying to be stealthy, they notice each other and nobody is surprised. Otherwise, the DM compares the Dexterity (Stealth) checks of everyone hiding with the passive Wisdom (Perception) of each creature on the other side. Anyone who doesn’t notice a threat is surprised.
A surprised creature still rolls initiative and gets a turn in the first round, but on that turn it can’t move or take an action, and it can’t take a reaction until the turn ends. After that, it acts normally.
Surprise is decided creature by creature. The elf with a passive Perception of 16 can spot the ambush while the rest of the party is caught flat-footed, and she acts normally on her first turn.
Setting up and running surprise
The whole group has to be quiet. Every creature trying to stay hidden rolls Stealth, so one clanking paladin in plate can give the game away. Pass without Trace adds +10 to everyone’s Stealth and makes surprise far more likely.
Low initiative makes it worse. A surprised creature can’t take reactions until its first turn ends, so one that rolls low can’t cast Shield or make opportunity attacks for most of the first round.
Monsters surprise players too.Bugbears deal an extra 2d6 when they hit a surprised creature in the first round, and a mimic is surprise in a box.
Camp defenses help.Alarm wakes you when something enters the warded area, which is the difference between being ambushed asleep and meeting the attack awake.
What changed in 2024
Surprise is much gentler in the 2024 rules. A surprised creature doesn’t lose its first turn; it has disadvantage on its initiative roll instead. The conditions tie into this: a creature that is invisible when it rolls initiative has advantage, and one that is incapacitated has disadvantage. The 2024 Alert feat now adds your proficiency bonus to initiative and lets you swap initiative with a willing ally.
Common questions
Is there a surprise round in 5e?
No. There’s no separate round. Everyone rolls initiative as normal, and surprised creatures simply can’t move or act on their first turn.
Can a surprised creature use its reaction?
Not until its first turn ends. Once that turn has passed, it can take reactions normally, even if the first round isn’t over yet.
How is surprise decided?
The DM compares the Stealth checks of the creatures sneaking up with the passive Perception of each creature on the other side. Anyone who doesn’t notice a threat is surprised; if nobody was trying to hide, nobody is surprised.
Can only part of the party be surprised?
Yes. Surprise is checked for each creature, so some party members can be surprised while others act normally.
Does surprise mean I get advantage on attacks?
Not by itself. Attacking a creature that can’t see you gives advantage, which often goes along with surprise, but surprise only takes away the victim’s first turn and reactions.
How does surprise work in the 2024 rules?
Surprised creatures have disadvantage on their initiative roll and otherwise act normally. They don’t lose their first turn.
Can’t take actions or reactions at all. A surprised creature in 2014 is much the same for its first turn; in 2024, incapacitated creatures roll initiative with disadvantage.