PurposeUnder emerging social media technology, mobile learners' behavior analysis and legality education have important practical significance. The research aims to detect the mobile learning (M-learning) learners' behavior in legality education under the background of the Internet era and improve the learning and teaching effect of online legality education and law popularization.Design/methodology/approachThis paper proposes a model based on deep learning (DL) fuzzy clustering analysis (FCA), and bidirectional encoder and decoder (ENDEC) of converter model to detect the mobile learners' behaviors in online legality education under the current social media. Then, the effectiveness of the proposed model is tested. The proposed model expects to be applied to multimedia teaching and law popularization activities and provides some theoretical reference and practical value for improving the effectiveness of online teaching.FindingsThe experimental results show that in the learner behavior detection process of M-learning-oriented online legality education, the model's accuracy can reach 99.8%. The response time is shorter than other algorithms. Overall, the application effect of the proposed model and algorithm is good and can be applied in practice.Research limitations/implicationsThe research results may lack universality due to the selected research methods. Therefore, researchers are encouraged to test the proposed methods further. In the future, it is necessary to expand the type and scale of text data to improve the accuracy of data detection.Practical implicationsThe research results provide a specific theoretical reference and practical significance for improving the learning effect of online M-learning-oriented legality education.Originality/valueThis paper meets the needs of mobile learner behavior analysis based on social media.