Traditional wavelength demultiplexers are usually designed by brute-force parameter sweeping that only uses a small parameter space, which limits the functionality and compactness of the device. Furthermore, the long design cycle required by these techniques reduces design efficiency and technology development. In this paper, we have designed a tunable four-channel wavelength demultiplexer using a recently proposed objective-first algorithm. High performance is achieved for this demultiplexer with a footprint of only 20.16μm2. The peak transmission efficiencies are -1.87 dB, -2.10 dB, -1.68 dB, -1.74 dB and the crosstalk are -14.0 dB, -13.2 dB, -13.7 dB, -16.3 dB at 1453 nm, 1511 nm, 1576 nm, 1639 nm, for each channel, respectively. Moreover, the working wavelength of each channel can be tuned by changing the refractive index of the demultiplexer.