This work deals with the method of hand written image classification by using machine learning and deep learning. Python along with Tensor Flow framework is used here for developing the classification model. Image classification can be considered as a supervised learning approach which works on a labelled dataset for classification. Though many research works are going on this machine learning based Image classification, yet it is challenging for accurate classification. This paper focuses on handwritten image data classification task using machine learning algorithms namely K-Nearest Neighbors (KNN), Support Vector Machine (SVM), and Random Forest classifier (RF). In this paper a comparative analysis is performed on the dataset based on various parameters using different machine learning algorithms. Results are discussed in terms of classification accuracy of different ML based algorithms. From our experiment, it has been noticed that RF Classifier exhibits the highest accuracy of 100% which is followed by SVM having the accuracy of 98% and finally a KNN model having a correctness of 97%. The novelty of this paper is that along with various ML algorithms (RF, KNN, SVM and Naive Bayes) we applied deep learning algorithms (CNN), with three different activation functions and their combinations (RELU, TANH and SIGMOID) along with variation of optimizers (Adam and SGD). Finally performance of the combined optimization method is found to be better than the performance of the individual optimization method.