The invention provides a 3D printing-based layered prefabricated defect coal and rock mass sample preparation device and method. The method comprises the following steps: structural parameters of underground coal measure strata coal and rock mass are collected on site, a digital strata model is established, a reasonable similarity material ratio is selected, a concrete material is prepared, a 3D printing technology is used to print and prepare a complex layered structural rock mass model, maintenance is carried out, after the maintenance is completed, the integral model is taken out, coring iscarried out on a specially-made coring machine with an adjustable base, machining and grinding are carried out on the coring machine, and finally the layered prefabricated defect coal and rock mass sample is obtained. According to the device and the method in the invention, various geological structures such as various joints, fractures, bedding, faults and the like contained in the underground engineering strata can be restored and simulated accurately, the attitude of the coal measure strata can be accurately reproduced; and the coal and rock mass sample is provided, thereby facilitating the mechanical behavioral research of the coal and rock mass with the complex layered structure.