Brain tumor is a disease that seriously threatens human health and can often be treated with risky surgeries. Experts detect brain tumor with high resolution magnetic resonance (MR) images. However, the expected accuracy value could not be reached in the studies carried out so far. The aim of this study is to develop a new approach for detecting brain tumor types using MR images. In the proposed approach, it is designed a CNN-based neural network from scratch. The results of the method were compared with existing networks. The proposed approach detected glioma tumors with 99.64%, meningiomas tumor with 96.53%, pituitary tumors with 98.39% and an average of 98.32% accuracy. The developed CNN based model is also compared with deep CNN models such as ResNet50, VGG19, DensetNet121 and InceptionV3, which are operated by transfer learning method. The results show that the proposed approach outperforms other deep neural networks.