XML 20 R1.htm IDEA: XBRL DOCUMENT v3.24.3
Document and Entity Information
12 Months Ended
Aug. 31, 2024
Cover [Abstract]  
Document Type DEF 14A
Amendment Flag false
Entity Registrant Name UNIFIRST CORPORATION
Entity Central Index Key 0000717954