How Far From the Wall Should I Install a Toilet?

You determine the location of the toilet relative to the surrounding walls when you cut the hole in the floor for the flange, which is the fitting that connects the toilet to the waste line. The distance from the back wall to the flange is based on the toilet design, while the clearances to side and front walls are set by the local building code.

...

Clearance to the Back and Side Walls

...
credit: Max Burnside/Demand Media

When determining the location of the toilet, take the measurement from the center of the flange to the surfaces of the finished walls. If the bathroom is still under construction, you can measure to the wall's bottom plate, but you must subtract the thickness of the wall covering from this measurement. The distance from the flange's center to the back wall is known as the toilet "rough-in" dimension. The most standard rough-in dimension is 12 inches, but some toilets call for a 10-inch or 14-inch rough-in. Confirm the rough-in dimension with the toilet installation instructions or manufacturer. Some builders like to leave an extra 1/2 inch from the back wall to ensure a comfortable fit.

Standard clearance from the flange center to each side wall is 15 inches. This is the minimum requirement set by the International Residential Code, or IRC, which is followed by most local building authorities. However, the National Kitchen and Bath Association, or NKBA, recommends a minimum of 18 inches at each side for improved comfort.

Clearance in Front

...

Building codes also require a minimum clearance in front of a toilet, to ensure comfortable access to the fixture. If your local building code follows the IRC, the minimum requirement is 21 inches of clear floor space in front of the toilet. Any wall, vanity, fixture or other element must be at least 21 inches from the front edge of the toilet. The NKBA recommends 30 inches for improved accessibility.