This article describes numerous classification techniques for detecting numbers in handwritten digits written by different people or with manual input, convolutional neural network (CNN), support vector machine (SVM), K-nearest neighbors (KNN), random forest classifier (RFC). The accuracy of different algorithms such as CNN, SVM, KNN and RFC in the handwriting recognition were compared. In the present work, to build and train neural networks or classifiers, I used the Modified National Institute of Standards and Technology Database (MNIST) dataset that contains 70000 digits with 250 different forms of writing, and the size of each image has 28×28. In this work, I proposed a model to implement a classification algorithm to recognize the handwritten digits. I have compared the results of some of the most used Machine Learning Algorithm like Random Forest Classifier (RFC), K-Nearest Neighbor (KNN), and Support Vector Machine (SVM), and with Deep Learning Algorithms like Convolutional Neural Network (CNN) using Keras with TensorFlow. Using these algorithms, I achieved an accuracy of around 98.76% using CNN, 97.38% using SVM, 96.51% using RFC, and 96.38% using KNN. I found CNN algorithm gives the highest accuracy around 98.76% to detect the handwritten digit. This work paves the way to detect different handwritten digits by different people in different fields.