First, remove the toilet. To do that, shut off the water at the valve underneath the left hand side of the toilet as you stand facing it. Flush the toilet and disconnect the water supply. Empty the toilet bowl using a sponge, a rag, or a shop vacuum with the paper filter removed (my favorite method). Remove the caps over the bolts at the base of the toilet and unscrew the nuts. Remove the nuts and washers and pull the entire toilet up rocking it gently from side to side to break the seal underneath.
Now, mark off the floor in a square or a rectangle that takes in the spongy floor area. Cut out that area with a circular saw concentrating on a steady, even, straight cut. Don’t cut any deeper than the floor is thick because of the possibility of cutting into wires or water lines. Remove the spongy flooring. Cut support lumber, usually 2×6s or 2×8s to fit between the existing floor joists on each side of the hole and install them with long screws, leaving half the width of the support lumber under the existing floor.
Now is a good time to inspect the soil pipe and toilet flange for damage or wear. Replace them, if necessary. You can leave the new toilet flange off, stub the new soil pipe up to the floor, and then install the new flange after you have finished repairing the floor.
Cut out a new piece of subfloor from the proper size plywood or particle board. CDX plywood works well here because of the recurring chance for water damage. You can also use cement board products like Durock manufactured by USG corporation http://www.usg.com/ if the dimensions are right. Cut a hole to fit around the protruding soil pipe allowing for the thickness of the closet flange neck where it passes through the new floor. You will want to be able to screw the closet flange down to the floor after you install the flange. Alternatively, you can install the closet flange to the proper height and then install the new subfloor but you will have to split the plywood piece through the center of the flange and then install additional support lumber to bear under the separation between the two pieces of subflooring.
Replace the vinyl flooring, tile, or hardwood with new material that matches the old as closely as possible or you can take advantage of the situation to replace the bathroom vinyl, tile, or hardwood flooring, which is the optimum choice for a clean, sharp job.
Install the new closet flange, screwing it down to the new flooring, and reset the toilet using a new bowl gasket. Inspect the water supply connection and replace it now, if necessary. Refill the toilet, flush it a few times, and inspect the plumbing from under the house, if possible. Caulk around the base of the toilet with a good quality acrylic latex with silicone caulk and you are done!
Discuss this and other Home Improvement Topics in our How To Forum