Metamaterials based on effective media can be used to produce a number of unusual physical properties (for example, negative refraction and invisibility cloaking) because they can be tailored with effective medium parameters that do not occur in nature. Recently, the use of coding metamaterials has been suggested for the control of electromagnetic waves through the design of coding sequences using digital elements ‘0’ and ‘1,' which possess opposite phase responses. Here we propose the concept of an anisotropic coding metamaterial in which the coding behaviors in different directions are dependent on the polarization status of the electromagnetic waves. We experimentally demonstrate an ultrathin and flexible polarization-controlled anisotropic coding metasurface that functions in the terahertz regime using specially designed coding elements. By encoding the elements with elaborately designed coding sequences (both 1-bit and 2-bit sequences), the x- and y-polarized waves can be anomalously reflected or independently diffused in three dimensions. The simulated far-field scattering patterns and near-field distributions are presented to illustrate the dual-functional performance of the encoded metasurface, and the results are consistent with the measured results. We further demonstrate the ability of the anisotropic coding metasurfaces to generate a beam splitter and realize simultaneous anomalous reflections and polarization conversions, thus providing powerful control of differently polarized electromagnetic waves. The proposed method enables versatile beam behaviors under orthogonal polarizations using a single metasurface and has the potential for use in the development of interesting terahertz devices.