Complex functional materials with three-dimensional micro- or nano-scale dynamic compositional features are prevalent in nature. However, the generation of three-dimensional functional materials composed of both soft and rigid microstructures, each programmed by shape and composition, is still an unsolved challenge. Here we describe a method to code complex materials in three-dimensions with tunable structural, morphological and chemical features using an untethered magnetic micro-robot remotely controlled by magnetic fields. This strategy allows the micro-robot to be introduced to arbitrary microfluidic environments for remote two- and three-dimensional manipulation. We demonstrate the coding of soft hydrogels, rigid copper bars, polystyrene beads and silicon chiplets into three-dimensional heterogeneous structures. We also use coded microstructures for bottom-up tissue engineering by generating cell-encapsulating constructs.