We discuss the circuit design of a digital multiradian phase detector that measures the phase difference between two 10 kHz square wave TTL signals and provides the result as a binary number. The phase resolution of the circuit is 1/64 period and its dynamic range is 256 periods. This circuit has been developed for fusion plasma interferometry with submillimeter waves on the ASDEX Upgrade tokamak. The results from interferometric density measurement are discussed and compared to those obtained with the previously used phase detectors, especially with respect to the occurrence of phase jumps. It is illustrated that the new phase measurement provides a powerful tool for automatic real-time validation of the measured density, which is important for feedback algorithms that are sensitive to spurious density signals.