The heterogeneity of arsenic (As) and cadmium (Cd) in paddy soils seriously hinders the assessment of contamination status and prediction of rice uptake. Their vertical patterns across different environmental conditions and the underlying mechanisms remain largely unexplored. In this study, maximum vertical differences of bioavailable As and Cd within 0–30 cm depth in paddy soils were 4.1-fold and four orders of magnitude, respectively. The vertical patterns of As and Cd followed the vertical redox gradient in long-term reduced paddies, but were shaped by the vertical pH gradient derived from acidic wastewater irrigation in partly oxidized soils. Iron(III)- and sulfate-reducing bacteria played key roles in the formation of vertical pH gradient and the immobilization of As and Cd by iron (hydr)oxides and sulfides under varied redox conditions. Soil redox and organic matter determined the transition between these two mechanisms via regulating microbial iron(III) and sulfate reduction processes. The work proposes that soil vertical As and Cd patterns directly affect the accumulation of As and Cd in different rice cultivars with different vertical root patterns. This is the first study elucidating the controlling mechanisms governing the vertical As and Cd patterns in paddy fields, providing important references to identify, manage and remediate contaminated paddy fields.