IMPORTANCE: The quality of cardiopulmonary resuscitation (CPR) affects hemodynamics, survival, and neurological outcomes following pediatric cardiopulmonary arrest (CPA). Most health care professionals fail to perform CPR within established American Heart Association guidelines. OBJECTIVE: To determine whether "just-in-time" (JIT) CPR training with visual feedback (VisF) before CPA or real-time VisF during CPA improves the quality of chest compressions (CCs) during simulated CPA. DESIGN, SETTING, AND PARTICIPANTS: Prospective, randomized, 2 x 2 factorial-design trial with explicit methods (July 1, 2012, to April 15, 2014) at 10 International Network for Simulation-Based Pediatric Innovation, Research, & Education (INSPIRE) institutions running a standardized simulated CPA scenario, including 324 CPR-certified health care professionals assigned to 3-person resuscitation teams (108 teams). INTERVENTIONS: Each team was randomized to 1 of 4 permutations, including JIT training vs no JIT training before CPA and real-time VisF vs no real-time VisF during simulated CPA. MAIN OUTCOMES AND MEASURES: The proportion of CCs with depth exceeding 50 mm, the proportion of CPR time with a CC rate of 100 to 120 per minute, and CC fraction (percentage CPR time) during simulated CPA. RESULTS: The quality of CPR was poor in the control group, with 12.7% (95% CI, 5.2%-20.1%) mean depth compliance and 27.1% (95% CI, 14.2%-40.1%) mean rate compliance. JIT training compared with no JIT training improved depth compliance by 19.9% (95% CI, 11.1%-28.7%; P < .001) and rate compliance by 12.0% (95% CI, 0.8%-23.2%; P = .037). Visual feedback compared with no VisF improved depth compliance by 15.4% (95% CI, 6.6%-24.2%; P = .001) and rate compliance by 40.1% (95% CI, 28.8%-51.3%; P < .001). Neither intervention had a statistically significant effect on CC fraction, which was excellent (>89.0%) in all groups. Combining both interventions showed the highest compliance with American Heart Association guidelines but was not significantly better than either intervention in isolation. CONCLUSIONS AND RELEVANCE: The quality of CPR provided by health care professionals is poor. Using novel and practical technology, JIT training before CPA or real-time VisF during CPA, alone or in combination, improves compliance with American Heart Association guidelines for CPR that are associated with better outcomes. TRIAL REGISTRATION: clinicaltrials.gov Identifier: NCT02075450.