A 3D-printed digital metamaterial embedded with electromagnets is fabricated. Switching electromagnets between the attaching (1 bit) and detaching (0 bit) modes activates different waveguides in the metamaterial. The underlying mechanism is investigated theoretically and experimentally. The hierarchical assemblies of unit cells, mimicking digital bits, allow programmable broadening of the bandgap of the metamaterial. As a service to our authors and readers, this journal provides supporting information supplied by the authors. Such materials are peer reviewed and may be re-organized for online delivery, but are not copy-edited or typeset. Technical support issues arising from supporting information (other than missing files) should be addressed to the authors. Please note: The publisher is not responsible for the content or functionality of any supporting information supplied by the authors. Any queries (other than missing content) should be directed to the corresponding author for the article.