This paper focuses on the safety-critical fixed-time formation control of quadrotor UAVs with disturbance and obstacle collision risk. The control scheme is organized in a distributed manner, with the leader’s position and velocity being estimated simultaneously by a fixed-time distributed observer. Meanwhile, a disturbance observer that combines fixed-time control theory and sliding mode control is designed to estimate the external disturbance. Based on these techniques, we design a nominal control law to drive UAVs to track the desired formation in a fixed time. Regarding obstacle avoidance, we first construct safety constraints using control barrier functions (CBFs). Then, obstacle avoidance can be achieved by solving an optimization problem with these safety constraints, thus minimally affecting tracking performance. The main contributions of this process are twofold. First, an exponential CBF is provided to deal with the UAV model with a high relative degree. Moreover, a robust exponential CBF is designed for UAVs with disturbance, which provides robust safety constraints to ensure obstacle avoidance despite disturbance. Finally, simulation results show the validity of the proposed method.