XML 13 R1.htm IDEA: XBRL DOCUMENT v3.7.0.1
Document And Entity Information - shares
6 Months Ended
Feb. 25, 2017
Mar. 31, 2017
Document Information [Line Items]    
Entity Registrant Name Unifirst Corp  
Entity Central Index Key 0000717954  
Trading Symbol unf  
Current Fiscal Year End Date --08-26  
Entity Filer Category Large Accelerated Filer  
Entity Current Reporting Status Yes  
Entity Voluntary Filers No  
Entity Well-known Seasoned Issuer Yes  
Document Type 10-Q  
Document Period End Date Feb. 25, 2017  
Document Fiscal Year Focus 2017  
Document Fiscal Period Focus Q2  
Amendment Flag false  
Common Class B [Member]    
Document Information [Line Items]    
Entity Common Stock, Shares Outstanding (in shares)   4,845,519
Common Class A [Member]    
Document Information [Line Items]    
Entity Common Stock, Shares Outstanding (in shares)   15,462,689