XML 13 R1.htm IDEA: XBRL DOCUMENT v3.8.0.1
Document And Entity Information - shares
6 Months Ended
Feb. 24, 2018
Mar. 30, 2018
Document Information [Line Items]    
Entity Registrant Name Unifirst Corporation  
Entity Central Index Key 0000717954  
Trading Symbol unf  
Current Fiscal Year End Date --08-25  
Entity Filer Category Large Accelerated Filer  
Document Type 10-Q  
Document Period End Date Feb. 24, 2018  
Document Fiscal Year Focus 2018  
Document Fiscal Period Focus Q2  
Amendment Flag false  
Common Stock    
Document Information [Line Items]    
Entity Common Stock, Shares Outstanding   15,420,788
Class B Common Stock    
Document Information [Line Items]    
Entity Common Stock, Shares Outstanding   3,711,009