Measure the dimensions of the stairs with a ruler.
Flip the carpet over so the backing is facing up. Lay the carpet down on several pieces of cardboard. The cardboard protects the surface underneath from the knife.
Mark the measurements on the back of the piece of carpet by placing the ruler on top and running the pencil down the edge. Place the markings next to one another if possible to maximize the number of treads from each piece of carpet.
Trim any excess pieces from around the edge. Place the straightedge ruler on top of the markings at the edge and run the utility knife or carpet cutter along the side of the ruler.
Cover the edges of the treads with carpet seam sealer to prevent the carpet from unraveling. Follow the manufacturer's instructions for application.