Measure the length, width and height of the available space for the bed. Cut a sheet of rolled paper to that length and width.
Lay the rolled paper on the floor. Have the person who will use the bed most often lie down on his back, with his hands locked behind his head and elbows out.
Mark the positions of the tips of his elbows on the paper. Check the available space again to see whether or not changing direction or lofting the bed would provide more space, if the person's elbows extend past the paper.
Cut two pieces of 2-by-4-inch stock lumber to the width of the available space for the bed. Cut two more pieces to the length of the available space. Check the ends of each board against a carpenter's square to ensure that they are cut to 90-degree angles.
Lay all the boards on your work bench on their 4-inch faces, with one of the ends facing you. Mark the side of the board facing the ceiling with an "A" about one foot from each end. Mark the side of the board facing the table with a "B" about one foot from each end.
Turn the boards on their 2-inch faces. Mark the side of the board facing the ceiling "C" and the side facing the table "D." Mark the ends of each board "E."
Set a marking gauge to 4 inches. Use the gauge to inscribe a 4-inch shoulder depth line across face C, A and D of each board, at each end.
Reset the marking gauge to 1 inch. Turn the boards so that side "C" faces the ceiling and side "A" the left side of the table. Place the gauge against side "B" on the shoulder line you inscribed in Step 7.
Use the gauge to inscribe a line from the shoulder line to the end of the board, at each end. Repeat for side "D."
Set the saw depth to 1 inch. Set the miter fence 4 inches from the saw blade. Place side "E" of the board you need to cut against the miter fence. Make 1-inch deep, 4-inch wide rabbet cuts -- which are grooves made at the ends of boards so that they will fit together -- in each end of each board, using the lines you inscribed.
Cut six pieces of 4-by-4-inch stock lumber to the height needed to support the bed platform. Cut 24-inch support posts, for example, if you want enclosed storage space beneath the bed or 12-inch posts if you want a futon frame or slat bed. Cut 48-inch posts for a child's loft bed frame or 60-inch posts for a lofted bed frame over a storage closet.
Place one of the short frame pieces across the tops of two of the posts, rabbet-side-up, with all corners and the ends of each frame piece flush with the sides and corners of each post.
Drill a single pilot hole down through the center point of each rabbet cut, into the center of the top of each post, using a 1/8-inch-diameter bit. Switch to a countersink bit. Place the point of the countersink bit in the pilot hole, and drill straight down about 1/4-inch deep.
Secure the short frame piece to the posts using 1/4-inch-thread, 4-inch-long wood screws. Repeat for the second short piece and two more posts.
Stand the two sets of connected posts in the space where you want the bed to be used. Turn the long frame pieces rabbet-side-down, and fit them onto the rabbets on top of each end of each connected set of posts.
Adjust the long boards until their edges and ends are flush with the edges and ends of the connected posts and the rabbet cuts in the short pieces.
Mark screw positions on a diagonal line from the corner of each post, one inch from the corner and three inches from the corner. Drill 1/8-inch-diameter pilot holes, countersink them, and secure the long pieces to the rest of the frame using 1/4-inch-thread, 4-inch-long wood screws.
Position the remaining pair of posts halfway between the pairs at each end; this will support the center of the long sides of the bed frame. Mark screw positions at one inch and three inches along a diagonal line from the right front corner of each post as you are facing it.
Drill down through the frame and into the top of the posts with a 1/8-inch-diameter bit, and countersink the holes. Secure the frame to the posts using 1/4-inch-thread, 4-inch-long wood screws.
Cut 1-by-4-inch pallet slats to the width of the bed frame; make enough slats to place them one inch apart, if you want to make a slat bed. For a platform bed, cut a single sheet of 1/2-inch-thick plywood to the length and width of the frame.
Drill a single pilot hole one inch and three inches from the long sides of the bed frame, along the center line of each slat. Countersink the holes, and secure the slats to the bed frame using 1/4-inch-thread, 2-inch-long wood screws.