PurposeThis study aims to investigate the relationship between building smart factories in manufacturing small- and medium-sized enterprises (SMEs) and firm performance and the moderating effect according to product complexity and company size.Design/methodology/approachData were collected from 206 companies selected in the list of SMEs, which had built smart factories, provided by the Smart Manufacturing Innovation Center in Korea. The collected data were analyzed using structural equation modeling (SEM) technique.FindingsFirst, production automation and big data utilization are associated positively with productivity, but not significantly with export performance. Second, supply chain integration is associated positively with both productivity and export performance. Third, product complexity moderates negatively the relationship of productivity with each of production automation, big data utilization and supply chain integration while moderating positively the relationship between supply chain integration and export performance. Finally, company size does not moderate significantly the relationship between productivity or export performance with any of production automation, big data utilization and supply chain integration.Originality/valueThis study contributes theoretically to literature by demonstrating the usefulness of building smart factories and suggesting how SMEs build a smart factory to enhance productivity and export performance from a business perspective. Moreover, this study contributes practically by proposing that SMEs should put priority on supply chain integration over production automation and big data utilization and execute different strategies of building smart factories depending on product complexity.