Internet of things (IoT) technology has empowered tangible objects to establish internet connections, facilitating data exchange with computational capabilities. With significant potential across sectors like healthcare, environmental monitoring, and industrial control, IoT represents a promising technological advancement. This study explores datasets from ToN-IoT’s IoT devices, focusing on multi-class classification, including normal and attack classes, with an additional aim of identifying potential attack sub-classes. Datasets comprise various IoT devices, such as refrigerators, garage doors, global positioning systems (GPS) sensors, motion lights, modbus devices, thermostats, and weather sensors. Comparative analysis is conducted between two prominent multiclass classification models, extreme gradient boosting (XGBoost) and light gradient boosting machine (LightGBM), utilizing accuracy and computational time metrics as evaluation criteria. Research findings highlight that the LightGBM model achieves superior accuracy at 78%, surpassing XGBoost 74.31%. However, XGBoost demonstrates an advantage with a shorter computational time of 1.23 seconds, compared to LightGBM 6.79 seconds. This study not only provides insights into multiclass classification model selection but also underscores the crucial consideration of the trade-off between accuracy and computational efficiency in decision-making. Research contributes to advancing our understanding of IoT security through effective classification methodologies. The findings offer valuable information for researchers and practitioners, emphasizing the nuanced decisions needed when selecting models based on specific priorities like accuracy and computational efficiency.