A wavelength detector that employs two metal-semiconductor-metal photodetectors with different subwavelength finger spacings is proposed and demonstrated. The resonance effect of the subwavelength-spaced fingers results in a photocurrent ratio that has one-to-one correspondence with the wavelengths of the monochromatic incident light. The device has a spectral range of 450 - 800nm with a resolution of 5nm. This device makes automatic wavelength calibration in optical instrumentation feasible.