When you need to lay hardwood flooring in a room that's out of square, you can make the problem less noticeable by carefully planning how to align the floorboards. If the difference in the room is less than 1/4 inch for every six feet of wall length, you probably won't have to worry, since the difference won't be noticeable to a casual observer. If the difference is greater than that, you can still keep it from being obvious by marking a balanced baseline and laying the boards parallel to the baseline, rather than the wall.
Measure the width of the room at both ends, perpendicular to the way you'll be laying the floorboards. If one end is more than about half an inch wider than the other, you'll need to decide how to compromise.
Measure the width of the room at both ends, parallel to the floorboards. If those measurements are the same, you can solve the problem by laying the floorboards parallel to the matching walls, since the unevenness won't be as noticeable if it occurs along the ends of the floorboards. However, that's not always possible, depending on the subfloor or the joists. It may also look odd to lay floorboards across a narrow hall rather than down it.
Take an exact measurement across each end of the room, if you need to lay floorboards parallel to the uneven walls. Divide in half the amount that the two walls are out of square. If the room measured 15 feet at one end and 15 feet 2 inches at the other, half the difference in that example would be one inch. Call that number X.
Measure out the width of one floorboard plus one foot, on the short side of the wall where you want to start laying floorboards. Mark that spot. On the long side, measure out the width of one floorboard plus one foot plus X and mark that also. Snap a chalk line between the two marks.
Lay the first floorboard so it's parallel to the chalk line rather than the wall and rip saw it to compensate for the angle of the wall if necessary. Nail it in place. Continue laying and nailing floorboards across the room until you reach the opposite wall, where you should have an equal gap at one end. Rip saw a board to fit on that wall also.
You can also snap a chalk line down the centre of the room halfway between each wall and begin laying the floor in the middle. Lay the first two boards in the centre of the room with their grooves facing each other and connect them with a slip tongue in the middle, then work outward toward each wall, compensating for the unevenness with the last board on each side.