Ddos is an attack method by sending a lot of packets into a network that causes the device not to run according to its function. This attack will result in machine or network resources cannot be accessed or used by the user. Various methods are used to detect DDOS attacks on SDN  , namely statistical methods, machine learning, SDN architecture, blockchain, Network Function Virtualization, honeynets, network slicing, and moving target defense. Because so many people use machine learning to detect DDoS attacks, it is necessary to do further research to find out which one is the best and has high accuracy. Therefore, a research entitled “Comparison of Machine Learning Algorithms in Detecting DDoS Attacks was made. In this study, three machine learning algorithms will be compared, namely XGBoost, Decision Tree and ANN. The methods used are data acquisition, data understanding, data preparation, modeling, performance evaluation, and conclusions. In this study it can be said that for accuracy, the highest model is XGBoost in determining attacks, but to execute it requires the longest time among other models tested. While Decision tree also has high accuracy, slightly below XGBoost, but the time required to execute is fast or short. Therefore, in this study it can be said that the Decision Tree is the best model in detecting and classifying DDoS attacks.Keywords: Ddos Attack, Machine Learning, Decision Tree, XGBoost, ANN.