You can measure from the wall behind the toilet to the center of the closet bolts. Measure to the center of the closet bolts if the toilet has four. Measure from the back of the new toilet to the mounting holes.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.