Experimental investigation of chemical reactions with full quantum state resolution for all reactants and products has been a long-term challenge. Here we prepare an ultracold few-body quantum state of reactants and demonstrate state-to-state chemistry for the recombination of three spin-polarized ultracold rubidium (Rb) atoms to form a weakly bound Rb2 molecule. The measured product distribution covers about 90% of the final products, and we are able to discriminate between product states with a level splitting as small as 20 megahertz multiplied by Planck’s constant. Furthermore, we formulate propensity rules for the distribution of products, and we develop a theoretical model that predicts many of our experimental observations. The scheme can readily be adapted to other species and opens a door to detailed investigations of inelastic or reactive processes.