Abstract Formaldehyde (H2CO) is an important precursor to organics like methanol (CH3OH). It is important to understand the conditions that produce H2CO and prebiotic molecules during star and planet formation. H2CO possesses both gas-phase and solid-state formation pathways, involving either UV-produced radical precursors or CO ice and cold (≲20 K) dust grains. To understand which pathway dominates, gaseous H2CO's ortho-to-para ratio (OPR) has been used as a probe, with a value of 3 indicating “warm” conditions and <3 linked to cold formation in the solid state. We present spatially resolved Atacama Large Millimeter/submillimeter Array observations of multiple ortho- and para-H2CO transitions in the TW Hya protoplanetary disk to test H2CO formation theories during planet formation. We find disk-averaged rotational temperatures and column densities of 33 ± 2 K, (1.1 ± 0.1) × 1012 cm−2 and 25 ± 2 K, (4.4 ± 0.3) × 1011 cm−2 for ortho- and para-H2CO, respectively, and an OPR of 2.49 ± 0.23. A radially resolved analysis shows that the observed H2CO emits mostly at rotational temperatures of 30–40 K, corresponding to a layer with z/R ≥ 0.25. The OPR is consistent with 3 within 60 au, the extent of the pebble disk, and decreases beyond 60 au to 2.0 ± 0.5. The latter corresponds to a spin temperature of 12 K, well below the rotational temperature. The combination of relatively uniform emitting conditions, a radial gradient in the OPR, and recent laboratory experiments and theory on OPR ratios after sublimation, led us to speculate that gas-phase formation is responsible for the observed H2CO across the TW Hya disk.