When replacing the toilet tank, you want it to have the same height as the old one, or you might find it doesn’t fit the space. This is especially important if you have the toilet recessed into shelving.
Take a tape measure and place the end on the floor, at the base of the wall where the tank will sit. Now extend the tape to the top of your existing tank and mark down the measurement, and that will tell you how high the tank needs to be. Alternatively, make a pencil mark along the line of the top of the tank and use it as a template for the new tank.