| Income Taxes (Tables)
 | 12 Months Ended | 
| Jun. 30, 2017 | 
|---|
| Income Tax Disclosure [Abstract] |  | 
| Schedule of Income before Income Taxes, Domestic and Foreign | 
The components of income before income taxes are as follows: 
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  
|   | Year ended June 30, |  
| (In thousands) | 2017 |   | 2016 |   | 2015 |  
| Domestic income before income taxes | $ | 615,906 | 
 |   | $ | 417,803 | 
 |   | $ | 157,251 | 
 |  
| Foreign income before income taxes | 557,340 | 
 |   | 440,389 | 
 |   | 276,880 | 
 |  
| Total income before income taxes | $ | 1,173,246 | 
 |   | $ | 858,192 | 
 |   | $ | 434,131 | 
 |  | 
| Schedule of Components of Income Tax Expense (Benefit) | 
The provision for income taxes is comprised of the following: 
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  
| (In thousands) | Year ended June 30, |  
| 2017 |   | 2016 |   | 2015 |  
| Current: |   |   |   |   |   |  
| Federal | $ | 200,831 | 
 |   | $ | 94,088 | 
 |   | $ | 63,123 | 
 |  
| State | 4,660 | 
 |   | 6,123 | 
 |   | 3,655 | 
 |  
| Foreign | 38,208 | 
 |   | 37,680 | 
 |   | 25,438 | 
 |  
|   | 243,699 | 
 |   | 137,891 | 
 |   | 92,216 | 
 |  
| Deferred: |   |   |   |   |   |  
| Federal | 444 | 
 |   | 15,645 | 
 |   | (22,390 | ) |  
| State | 2,852 | 
 |   | 3,583 | 
 |   | 409 | 
 |  
| Foreign | 175 | 
 |   | (3,349 | ) |   | (2,262 | ) |  
|   | 3,471 | 
 |   | 15,879 | 
 |   | (24,243 | ) |  
| Provision for income taxes | $ | 247,170 | 
 |   | $ | 153,770 | 
 |   | $ | 67,973 | 
 |  | 
| Schedule of Deferred Tax Assets and Liabilities | 
The significant components of deferred income tax assets and liabilities are as follows: 
|  |  
|  |  |  |  |  |  |  |  |  
| (In thousands) | As of June 30, |  
| 2017 |   | 2016 |  
| Deferred tax assets: |   |   |   |  
| Tax credits and net operating losses | $ | 134,052 | 
 |   | $ | 116,277 | 
 |  
| Employee benefits accrual | 106,637 | 
 |   | 109,524 | 
 |  
| Stock-based compensation | 15,252 | 
 |   | 13,607 | 
 |  
| Inventory reserves | 95,200 | 
 |   | 94,783 | 
 |  
| Non-deductible reserves | 43,140 | 
 |   | 34,484 | 
 |  
| Depreciation and amortization | 3,415 | 
 |   | 15,857 | 
 |  
| Unearned revenue | 15,757 | 
 |   | 14,375 | 
 |  
| Other | 26,538 | 
 |   | 26,877 | 
 |  
| Gross deferred tax assets | 439,991 | 
 |   | 425,784 | 
 |  
| Valuation allowance | (120,708 | ) |   | (104,968 | ) |  
| Net deferred tax assets | $ | 319,283 | 
 |   | $ | 320,816 | 
 |  
| Deferred tax liabilities: |   |   |   |  
| Unremitted earnings of foreign subsidiaries not indefinitely reinvested | $ | (13,213 | ) |   | $ | (11,571 | ) |  
| Deferred profit | (13,657 | ) |   | (10,346 | ) |  
| Unrealized gain on investments | (2,707 | ) |   | (604 | ) |  
| Total deferred tax liabilities | (29,577 | ) |   | (22,521 | ) |  
| Total net deferred tax assets | $ | 289,706 | 
 |   | $ | 298,295 | 
 |  | 
| Schedule of Effective Income Tax Rate Reconciliation | 
The reconciliation of the United States federal statutory income tax rate to KLA-Tencor’s effective income tax rate is as follows: 
|  |  
|  |  |  |  |  |  |  |  |  |  
|   | Year ended June 30, |  
|   | 2017 |   | 2016 |   | 2015 |  
| Federal statutory rate | 35.0 |  % |   | 35.0 |  % |   | 35.0 |  % |  
| State income taxes, net of federal benefit | 0.4 |  % |   | 0.9 |  % |   | 0.7 |  % |  
| Effect of foreign operations taxed at various rates | (12.2 | )% |   | (13.0 | )% |   | (15.3 | )% |  
| Research and development tax credit | (1.1 | )% |   | (1.9 | )% |   | (3.7 | )% |  
| Net change in tax reserves | 1.3 |  % |   | (2.2 | )% |   | 1.5 |  % |  
| Domestic manufacturing benefit | (1.5 | )% |   | (1.5 | )% |   | (2.1 | )% |  
| Effect of stock-based compensation | (0.2 | )% |   | 0.3 |  % |   | 0.8 |  % |  
| Other | (0.6 | )% |   | 0.3 |  % |   | (1.2 | )% |  
| Effective income tax rate | 21.1 |  % |   | 17.9 |  % |   | 15.7 |  % |  | 
| Summary of Income Tax Contingencies | 
A reconciliation of gross unrecognized tax benefits is as follows: 
 
|  |  
|  |  |  |  |  |  |  |  |  |  |  |  |  
|   | Year ended June 30, |  
| (In thousands) | 2017 |   | 2016 |   | 2015 |  
| Unrecognized tax benefits at the beginning of the year | $ | 50,365 | 
 |   | $ | 69,018 | 
 |   | $ | 59,575 | 
 |  
| Increases for tax positions taken in prior years | 6,788 | 
 |   | 4,245 | 
 |   | 1,245 | 
 |  
| Decreases for tax positions taken in prior years | (246 | ) |   | (1,209 | ) |   | (7 | ) |  
| Increases for tax positions taken in current year | 14,696 | 
 |   | 13,636 | 
 |   | 11,634 | 
 |  
| Decreases for settlements with taxing authorities | — | 
 |   | (8,762 | ) |   | — | 
 |  
| Decreases for lapsing of statutes of limitations | (3,164 | ) |   | (26,563 | ) |   | (3,429 | ) |  
| Unrecognized tax benefits at the end of the year | $ | 68,439 | 
 |   | $ | 50,365 | 
 |   | $ | 69,018 | 
 |  |