  We study $T\bar T$ deformations of 2d CFTs with periodic boundary conditions.
We relate these systems to string models on $\mathbb{R}\times {S}^1\times{\cal
M}$, where $\cal M$ is the target space of a 2d CFT. The string model in the
light cone gauge is identified with the corresponding 2d CFT and in the static
gauge it reproduces its $T\bar T$ deformed system. This relates the deformed
system and the initial one by a worldsheet coordinate transformation, which
becomes a time dependent canonical map in the Hamiltonian treatment. The
deformed Hamiltonian defines the string energy and we express it in terms of
the chiral Hamiltonians of the initial 2d CFT. This allows exact quantization
of the deformed system, if the spectrum of the initial 2d CFT is known. The
generalization to non-conformal 2d field theories is also discussed.
