XML 12 R1.htm IDEA: XBRL DOCUMENT v3.8.0.1
Document And Entity Information - shares
3 Months Ended
Nov. 25, 2017
Dec. 29, 2017
Document Information [Line Items]    
Entity Registrant Name Unifirst Corp  
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 Nov. 25, 2017  
Document Fiscal Year Focus 2018  
Document Fiscal Period Focus Q1  
Amendment Flag false  
Common Stock    
Document Information [Line Items]    
Entity Common Stock, Shares Outstanding   15,474,582
Class B Common Stock    
Document Information [Line Items]    
Entity Common Stock, Shares Outstanding   4,815,519