When you purchase new guardrails, the manufacturer should include the necessary hardware for installing the pieces. The only tools needed are a screwdriver or drill and a wrench for tightening the bolt into the bed frame. If your new rails lack the needed hardware, contact the manufacturer for a replacement. When you use a different bolt for the rails, you risk not providing adequate support for the guardrails.
The size of bolts used for bed guardrails is typically 1 1/2 inches. "Size" also refers to the length of the bolts, and the bolts used in bed guardrails are 2 inches long or longer, depending on the bed guardrail manufacturer. The bolt must be long enough to go through a rail and deeply enough into the bed frame to support the rail and keep it from coming loose.
Metal bolts are available in multiple shapes, sizes and types. A carriage bolt has a round head that feels completely smooth and a small square or rectangular piece underneath the head. Hex bolts have a hexagonal head. Your bed guardrails might feature a socket screw. Socket screws have a small hole in the center of a round head. The hole has an unusual shape that screws into place with an Allen wrench. If the manufacturer claims that the guardrails attach to the bed without any tools required, then the set probably includes socket screws with an Allen wrench. Lag bolts with a pointed end and hexagonal head are another bolt possibility for bed guardrails.
If you lose or break a bolt for existing guardrails, purchase new bolts that closely resemble the originals. Take one of the existing bolts to a hardware store, and find a new bolt that matches it in terms of head and size. Do not mix and match bolts because the manufacturer uses the optimal bolts for that rail. Using a different bolt might reduce a guardrail's strength or effectiveness.