A sheet size detection apparatus including, a sheet stacking device on
which sheets are stacked and which can be loaded into and unloaded from a
loading portion, a sheet size selection member provided on the sheet
stacking device, a position of the sheet size selection member being
changeable in accordance with a size of stacked sheets, a sheet size
detection device provided on the loading portion for detecting the sheet
size based on a relative positional relationship with the sheet size
selection member, a locking member that can lock the sheet size selection
member, and an unlock member for releasing a locking operation of the
locking member.