The bin packing problem is a classical problem widely existing in practical applications, such as shipping, warehousing and manufacturing industries. Whereas current research mainly focuses on reducing packing costs by optimizing the packing scheme, this study explores a novel approach by redesigning the bin sizes to fit the items ready to be packed. Specifically, this study considers a general three-dimensional open dimension problem (3D-ODP) where all dimensions, i.e. length, width and height, of a number of heterogeneous bin types are unknown and need to be decided. Based on the designed bin types, the corresponding packing scheme with minimal total costs is optimized, which is referred to as a three-dimensional multiple-bin-size bin packing problem (3D-MBSBPP). The combination of 3D-ODP and 3D-MBSBPP is redefined as a three-dimensional bin design and packing problem (3D-BDPP), for which a two-layer heuristic is developed. It consists of an outer heuristic framework (i.e. genetic algorithm or differential evolution algorithm) to design bin types, and an inner deterministic constructive heuristic (i.e. placement algorithm) to generate an effective solution for the 3D-MBSBPP. Extensive simulation tests on the classical benchmark and a case study derived from an e-commerce company are conducted to verify the algorithms and deduce managerial insights.