XML 12 R1.htm IDEA: XBRL DOCUMENT v3.7.0.1
Document And Entity Information - shares
9 Months Ended
May 27, 2017
Jun. 30, 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  
Document Type 10-Q  
Document Period End Date May 27, 2017  
Document Fiscal Year Focus 2017  
Document Fiscal Period Focus Q3  
Amendment Flag false  
Common Stock    
Document Information [Line Items]    
Entity Common Stock, Shares Outstanding   15,421,381
Class B Common Stock    
Document Information [Line Items]    
Entity Common Stock, Shares Outstanding   4,845,519