XML 13 R1.htm IDEA: XBRL DOCUMENT v3.8.0.1
Document and Entity Information - shares
6 Months Ended
Jan. 31, 2018
Mar. 05, 2018
Document And Entity Information [Abstract]    
Document Type 10-Q  
Amendment Flag false  
Document Period End Date Jan. 31, 2018  
Document Fiscal Year Focus 2018  
Document Fiscal Period Focus Q2  
Trading Symbol KMG  
Entity Registrant Name KMG CHEMICALS INC  
Entity Central Index Key 0001028215  
Current Fiscal Year End Date --07-31  
Entity Filer Category Accelerated Filer  
Entity Common Stock, Shares Outstanding   15,505,350