This study computationally discusses the defocusing tolerance of recording codes for multilayered waveguide holographic read-only memory that uses the telecentric optical system. In this memory, a high code rate (η) and large focusing margin (Δm) are respectively required for a large capacity and for fabricating its reproduction optical unit without a focusing servo. The conventional 2/16 code possesses a low η of 0.125, and the 4/9 code with a high η of 0.44 exhibits a small Δm of ±20μm. Two types of template matching codes, namely, the 4/16 code and modified 4/9 code were examined in terms of meeting both requirements. The 4/16 code, in which the distances between bright code pixels were increased, resulted in an η of 0.25 and 7.5 times larger Δm than the conventional 4/9 code. Also, a high η of 0.44 and a two times larger Δm improvement were confirmed in the 4/9 code when the code was modified with code spot position shift.