We show that to cubic order double field theory is encoded in Yang-Mills theory. To this end we use algebraic structures from string field theory as follows: The L-infinity-algebra of Yang-Mills theory is the tensor product K circle times g of the Lie algebra g of the gauge group and a "kinematic algebra" K that is a C-infinity-algebra. This structure induces a cubic truncation of an L-infinity-algebra on the subspace of level-matched states of the tensor product K circle times (K) over bar of two copies of the kinematic algebra. This L-infinity-algebra encodes double field theory. More precisely, this construction relies on a particular form of the Yang-Mills L-infinity-algebra following from string field theory or from the quantization of a suitable worldline theory.