According to WHO, in 2017, the estimated number of people with mental disorders worldwide was around 450 million people, including schizophrenia. Globally, for the condition of Southeast Asia alone, the number of people affected by mental disorders is 13.5%. Meanwhile, 13.4% of cases in Indonesia are affected by mental illness. The Association of Mental Medicine Specialists (PDSKJ) during October 2020 noted that 5661 people who did self-examination through the PDSKJ website came from 31 provinces and found that 32% of the population had psychological problems and 68% had no psychological issues. Seeing that the level of mental illness in Indonesia is increasing, it is necessary to have a system to help the community with early prevention and treatment. With the growth of technology at its peak, Machine Learning technology can overcome the problem which is part of artificial intelligence. Furthermore, machine learning has an important role in improving the quality of health services because it is able to provide a medical diagnosis to predict disease. Therefore, the authors conducted a study to create a system to identify mental illness using the TF-IDF method. This method calculates the word weighting from a collection of complaints that the user gives. Then, these complaints will be classified using the KNN algorithm classification method and the Levenshtein Distance method to find the distance between the word inputted by the user and the word in the database and then calculate the number of differences between the two strings in the form of a matrix. The accuracy result of this machine learning classification is 0.928 or 93%, and will be visualized through web-based software using the Flask framework.