We demonstrate a novel optical phase detector that uses sum-frequency mixing in a nonlinear waveguide. By monitoring the near-field pattern of the sum-frequency light radiated from the waveguide surface, the relative phase of two input light beams can be measured. By using an Al(x)Ga(1-x)As waveguide optimized for sum-frequency generation with lambda = 1.06 microm input light, we demonstrate a simple phase detector capable of resolving phase shifts of less than 0.2 rad. This phase detector is also used in an interferometer configuration as a gigahertz-resolution frequency monitor.