A spectrometer includes a substrate; a slit which is provided on the substrate and through which light is incident onto the substrate; a metasurface including nanostructures that is configured to reflect and focus the light incident thereon through the slit, at different angles based on respective wavelengths; and a sensor which is provided on one side of the substrate that is opposite to another side of the substrate at which the metasurface is disposed, and configured to receive the light from the metasurface.