A mattress foundation includes a top frame and a bottom frame. Bracket assemblies are between the top frame and the bottom frame. The bottom frame has a first bottom segment and a second bottom segment each rotatably connected to bracket assemblies. The top frame has a first top segment and the second top segment each rotatably connected to bracket assemblies. The first bottom segment, the second bottom segment, the first top segment, and the second top segment are rotatable relative to each other and the bracket assemblies between a folded position and an unfolded position.