A code blue is a hospital emergency alert meaning a patient’s heart has stopped beating or they’ve stopped breathing. It triggers an immediate, coordinated response from a specialized team trained to restart the heart and restore breathing. Of the roughly 350,000 in-hospital cardiac arrests that occur each year in the U.S., about 23% of patients survive to leave the hospital.
What Triggers a Code Blue
The two most common reasons for calling a code blue are cardiac arrest, where the heart stops pumping blood, and respiratory arrest, where breathing stops entirely. In practice, one usually leads to the other within minutes, so the response treats both simultaneously.
Any hospital staff member who finds a patient unresponsive and not breathing normally can activate a code blue. In most hospitals, this happens by pressing a button at the bedside, calling a dedicated number, or alerting a charge nurse who pages the team. The announcement goes out over the hospital’s overhead speaker system with the words “Code Blue” followed by the exact location, so the response team knows where to run. Some hospitals have moved toward plain-language announcements like “Medical Emergency, Room 412” because code terminology isn’t standardized across every facility, but “Code Blue” for cardiac arrest remains the most widely recognized.
Who Responds and What They Do
A code blue team typically includes 10 or more people, each with a specific role. The core members are a physician team leader (usually an ICU doctor or hospitalist), an anesthesia provider, one or two respiratory therapists, several nurses, a pharmacist, and additional staff trained in chest compressions. Security may arrive to manage hallway traffic, and a chaplain or pastoral care worker is often called in case the patient’s family needs support.
The physician team leader runs the entire response, making decisions about medications, defibrillation, and when to stop or continue efforts. They do not perform hands-on procedures themselves so they can maintain a clear view of the situation. A second physician handles procedures like placing IV lines. The anesthesia provider focuses entirely on securing the airway, inserting a breathing tube so oxygen can reach the lungs reliably. Respiratory therapists take over ventilation once the airway is established and may rotate in for chest compressions.
Nurses divide into distinct jobs: one administers medications, one records every intervention and its exact timestamp, and others assist with equipment or relieve compressors. The pharmacist reviews the patient’s medication history on the spot, flags potential drug interactions, and prepares doses. This division of labor is rehearsed regularly so the team can function smoothly under extreme time pressure.
What Happens During the Code
The first action is always chest compressions, which manually pump blood through the body when the heart can’t. High-quality compressions mean pushing at least two inches deep into the chest at a rate of 100 to 120 pushes per minute. That pace is physically exhausting, so compressors swap out every two minutes. Between rounds of compressions, the team pauses briefly to check the heart’s rhythm on a monitor.
What happens next depends on what the monitor shows. If the heart is in a rhythm that can respond to an electrical shock (called a shockable rhythm), the team delivers a shock from a defibrillator immediately. If the rhythm isn’t shockable, they continue compressions and give adrenaline (epinephrine) through an IV every three to five minutes to try to stimulate heart activity. After each two-minute cycle of compressions, the team rechecks the rhythm, shocks again if appropriate, and layers in additional medications if needed.
Throughout the code, the team also works to identify why the arrest happened in the first place. The most common reversible causes include severe blood loss, dangerously low oxygen levels, blood clots in the lungs or heart, electrolyte imbalances, and drug reactions. Fixing the underlying cause is often the difference between a successful resuscitation and one that fails.
The Crash Cart
Every code blue revolves around a crash cart, a tall rolling cabinet stocked with everything the team needs. On top sits the defibrillator and a bag-valve mask for manual breathing support. Drawers contain airway equipment like laryngoscope blades (used to guide a breathing tube into the windpipe), IV supplies, syringes, and pre-loaded emergency medications. An oxygen cylinder and a rigid board (slid under the patient’s back to make compressions more effective on a soft hospital mattress) hang on the sides. IV fluids are stored at the bottom.
Crash carts are checked on a regular schedule, often daily or weekly, to make sure every medication is present and not expired and every piece of equipment works. A broken seal on the cart tells staff it has been opened and needs restocking.
How Long a Code Blue Lasts
Most code blues last between 20 and 40 minutes, though some are shorter if the heart responds quickly to defibrillation, and some run longer in younger patients or when a reversible cause is strongly suspected. A large study of nearly 349,000 in-hospital cardiac arrests found that about two-thirds of patients regain a pulse at some point during resuscitation. Survival drops steeply with time, though. By 39 minutes of continuous CPR without a pulse returning, the chance of surviving to hospital discharge falls below 1%.
The physician team leader ultimately decides when to stop resuscitation efforts. That decision weighs the patient’s overall health, how long CPR has been underway, whether any reversible cause remains untreated, and the patient’s previously expressed wishes about end-of-life care.
What Happens After a Successful Code
When a patient’s heart starts beating on its own again, the emergency is far from over. The patient is transferred to an intensive care unit for close monitoring, often on a ventilator. The immediate priorities are stabilizing blood pressure, ensuring the brain and other organs are getting enough oxygen, and figuring out what caused the arrest so it doesn’t happen again.
A 12-lead heart tracing is done quickly to check for signs of a heart attack, which is one of the most common triggers. If a heart attack is confirmed, the patient may go straight to a cardiac catheterization lab for a procedure to reopen the blocked artery. Oxygen delivery is carefully controlled because too much oxygen after resuscitation can actually cause additional tissue damage. Blood pressure, heart rhythm, and breathing are monitored continuously for at least the first 24 to 48 hours, since the risk of another arrest is highest in that window.
Among patients who survive to leave the hospital, roughly two-thirds recover with good brain function. The remaining third may have varying degrees of neurological impairment, depending on how long the brain went without adequate blood flow during the arrest.
Other Hospital Color Codes
Code blue is the best known, but hospitals use a full color-coded system for different emergencies. Code red typically means fire. Code pink signals an infant or child abduction. Code gray may indicate a combative person, and code silver often refers to an active threat with a weapon. The specific meanings vary by hospital, which is one reason some systems are shifting to plain-language announcements. If you hear a code called during a hospital visit, the most helpful thing you can do is stay out of hallways and follow any instructions from staff.