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