Researchers have been trying to design metamaterial or metasurface with desired medium properties in a simple and flexible way. However, it is difficult to balance the performance, complexity, and cost. Digital circuits and systems have the abilities of describing the magnificent information world by simply using only two numbers, "0" and "1." In this article, inspired by the digital electronics, we propose an approach that can synthesize the metasurface with arbitrary desired phase as easily as Boolean algebra. First, the notions of "phase bits" and "phase bytes" are originally developed. Then, the metasurface elements and the corresponding phase control circuits are designed to synthesize "phase bytes" with "phase bits." Finally, several examples of the beam forming, the double beam, and the dynamic vortex beam are applied, demonstrating the capabilities and simplicity of our proposed approach in this article. This study makes it becomes feasible to synthesize metasurface as flexibly as digital techniques and may attract many interests, including anomalous reflection, dynamic hologram creation, 6G wireless communication, and others.