libd3 is a Mata wrapper around the D3 JavaScript library for use in Stata and Mata programs. The class and methods are used to create individual and/or reusable Stata/Mata programs/functions to decrease the amount of time required to generate customized and interactive web-based data visualizations.