The photoresponse properties of nanocrystalline tin dioxide (SnO2) thin films with different grain sizes were systematically studied for fabricating transparent oxide-based ultraviolet (UV) photodetector. SnO2 nanoparticles were synthesized using the coprecipitation method and calcination temperatures were varied (400 °C–800 °C) to prepare SnO2 particles of different grain sizes (∼8 nm–∼42 nm). Subsequently, thin films of SnO2 nanoparticles were deposited using the spin-coating technique to fabricate UV photodetectors. The optical transparency of SnO2 thin films was improved by 10 % with the increasing grain size of the sample, while the band gap of the films was found to vary from 3.718 eV to 3.761 eV. The responsivity (Rλ) and the external quantum efficiency (EQE) of SnO2 based photodetector were noticeably large (Rλ = 200 mA/W and EQE = 90 %) in the UV range for devices with the smallest grain sizes (∼8 nm). Moreover, the same device exhibited a much faster photoresponse time (∼2 s) and a large photo-to-dark current ratio (∼103). The structural and spectroscopic studies on the SnO2 thin films revealed that the microscopic parameters like grain size, grain boundary potential, and surface oxygen vacancies play significant roles in modulating the optical properties and photoresponse of the nanocrystalline SnO2 thin films.