The composition of planetary solids and gases is largely rooted in the processing of volatile elements in protoplanetary disks. To shed light on the key processes, we carry out a comparative analysis of the gas-phase carbon abundance in two systems with a similar age and disk mass, but different central stars: HD 100546 and TW Hya. We combine our recent detections of C$^{0}$ in these disks with observations of other carbon reservoirs (CO, C$^{+}$, C$_{2}$H) and gas mass and warm gas tracers (HD, O$^{0}$), as well as spatially resolved ALMA observations and the spectral energy distribution. The disks are modelled with the DALI 2D physical-chemical code. Stellar abundances for HD 100546 are derived from archival spectra. Upper limits on HD emission from HD 100546 place an upper limit on the total disk mass of $leq0.1,M_{odot}$. The gas-phase carbon abundance in the atmosphere of this warm Herbig disk is at most moderately depleted compared to the interstellar medium, with [C]/[H]$_{rm gas}=(0.1-1.5)times 10^{-4}$. HD 100546 itself is a $lambda,$Bo{o}tis star, with solar abundances of C and O but a strong depletion of rock-forming elements. In the gas of the T Tauri disk TW Hya, both C and O are strongly underabundant, with [C]/[H]$_{rm gas}=(0.2-5.0)times 10^{-6}$ and C/O${>}1$. We discuss evidence that the gas-phase C and O abundances are high in the warm inner regions of both disks. Our analytical model, including vertical mixing and a grain size distribution, reproduces the observed [C]/[H]$_{rm gas}$ in the outer disk of TW Hya and allows to make predictions for other systems.