We report a deep-learning based compact spectrometer. Using a spectral encoder chip composed of unique plasmonic tiles (containing periodic nanohole-arrays), diffraction patterns created by the transmitted light through these tiles are captured by a CMOS sensor-array, without the use of any lenses or other components between the plasmonic encoder and the CMOS-chip. A neural network rapidly reconstructs the input light spectrum from the recorded lensless image data, which was blindly tested on randomly-generated new spectra to demonstrate the success of this computational on-chip spectrometer, which will find applications in various fields that demand low-cost and compact spectrum analyzers.