H2CO is one of the most readily detected organic molecules in protoplanetary disks. Yet its distribution and dominant formation pathway(s) remain largely unconstrained. To address these issues, we present ALMA observations of two H2CO lines (3_{12}-2_{11} and 5_{15}-4_{14}) at 0.5 (~30 au) spatial resolution toward the disk around the nearby T Tauri star TW Hya. Emission from both lines is spatially resolved, showing a central depression, a peak at 0.4 radius, and a radial decline at larger radii with a bump at ~1, near the millimeter continuum edge. We adopt a physical model for the disk and use toy models to explore the radial and vertical H2CO abundance structure. We find that the observed emission implies the presence of at least two distinct H2CO gas reservoirs: (1) a warm and unresolved inner component (<10 au), and (2) an outer component that extends from ~15 au to beyond the millimeter continuum edge. The outer component is further constrained by the line ratio to arise in a more elevated disk layer at larger radii. The inferred H2CO abundance structure agrees well with disk chemistry models, which predict efficient H2CO gas-phase formation close to the star, and cold H2CO grain surface formation, through H additions to condensed CO, followed by non-thermal desorption in the outer disk. The implied presence of active grain surface chemistry in the TW Hya disk is consistent with the recent detection of CH3OH emission, and suggests that more complex organic molecules are formed in disks, as well.