The conformation of an ideal polymer chain confined in a box with a D×D hole is studied by N-step random walk simulations. For a polymer chain tethered inside the box, three conformational states are observed when the chain length is increased. For short chains the polymer assumes “mushroom” configurations. Increasing the chain length leads to a state in which the polymer fills the box. When the chain is long enough, the polymer escapes from the box, assuring an overall random walk state. Probability distributions of the free end and end-to-end distance are used to characterize polymer conformations. The escape transition is determined by the disappearance of the bimodal feature in the end-to-end probability density function. A crossover of the free energy difference between the confined and escaped states signals an escape transition analogous to the coil-globule transition of a free ideal chain.