| Condensed Consolidated Statements of Stockholders' Equity (Unaudited) - USD ($)shares in Thousands, $ in Thousands
 | Total | Total KLA Stockholders’ Equity | Common Stock and Capital in Excess of Par Value, Shares | Common Stock and Capital in Excess of Par Value, Amount | Retained Earnings | Accumulated Other Comprehensive Income (Loss) | Non- Controlling Interest | 
| Beginning balance (in shares) at Jun. 30, 2021 |  |  | 152,776 |  |  |  |  | 
| Beginning balance at Jun. 30, 2021 | $ 3,375,642 | $ 3,377,554 |  | $ 2,175,988 | $ 1,277,123 | $ (75,557) | $ (1,912) | 
| Increase (Decrease) in Stockholders' Equity |  |  |  |  |  |  |  | 
| Net income attributable to KLA | 1,068,417 | 1,068,417 |  |  | 1,068,417 |  |  | 
| Net income attributable to non-controlling interest | 68 |  |  |  |  |  | 68 | 
| Other comprehensive income (loss) | (2,487) | (2,487) |  |  |  | (2,487) |  | 
| Net issuance under employee stock plans (in shares) |  |  | 160 |  |  |  |  | 
| Net issuance under employee stock plans | (46,532) | (46,532) |  | (46,532) |  |  |  | 
| Repurchase of common stock (in shares) |  |  | (1,190) |  |  |  |  | 
| Repurchase of common stock | (399,677) | (399,677) |  | (16,966) | (382,711) |  |  | 
| Cash dividends and dividend equivalents declared | (161,561) | (161,561) |  |  | (161,561) |  |  | 
| Stock-based compensation expense | 25,216 | 25,216 |  | 25,216 |  |  |  | 
| Ending balance (in shares) at Sep. 30, 2021 |  |  | 151,746 |  |  |  |  | 
| Ending balance at Sep. 30, 2021 | 3,859,086 | 3,860,930 |  | 2,137,706 | 1,801,268 | (78,044) | (1,844) | 
| Beginning balance (in shares) at Jun. 30, 2021 |  |  | 152,776 |  |  |  |  | 
| Beginning balance at Jun. 30, 2021 | 3,375,642 | 3,377,554 |  | 2,175,988 | 1,277,123 | (75,557) | (1,912) | 
| Increase (Decrease) in Stockholders' Equity |  |  |  |  |  |  |  | 
| Net income attributable to KLA | 2,516,433 |  |  |  |  |  |  | 
| Net income attributable to non-controlling interest | 229 |  |  |  |  |  |  | 
| Other comprehensive income (loss) | 4,024 |  |  |  |  |  |  | 
| Repurchase of common stock (in shares) |  |  | (3,833) |  |  |  |  | 
| Repurchase of common stock | (1,394,217) |  |  |  |  |  |  | 
| Ending balance (in shares) at Mar. 31, 2022 |  |  | 149,375 |  |  |  |  | 
| Ending balance at Mar. 31, 2022 | 4,078,624 | 4,080,307 |  | 2,179,229 | 1,972,611 | (71,533) | (1,683) | 
| Beginning balance (in shares) at Sep. 30, 2021 |  |  | 151,746 |  |  |  |  | 
| Beginning balance at Sep. 30, 2021 | 3,859,086 | 3,860,930 |  | 2,137,706 | 1,801,268 | (78,044) | (1,844) | 
| Increase (Decrease) in Stockholders' Equity |  |  |  |  |  |  |  | 
| Net income attributable to KLA | 717,444 | 717,444 |  |  | 717,444 |  |  | 
| Net income attributable to non-controlling interest | 73 |  |  |  |  |  | 73 | 
| Other comprehensive income (loss) | 1,565 | 1,565 |  |  |  | 1,565 |  | 
| Net issuance under employee stock plans (in shares) |  |  | 205 |  |  |  |  | 
| Net issuance under employee stock plans | 31,157 | 31,157 |  | 31,157 |  |  |  | 
| Repurchase of common stock (in shares) |  |  | (1,104) |  |  |  |  | 
| Repurchase of common stock | (429,874) | (429,874) |  | (15,604) | (414,270) |  |  | 
| Cash dividends and dividend equivalents declared | (160,461) | (160,461) |  |  | (160,461) |  |  | 
| Stock-based compensation expense | 27,766 | 27,766 |  | 27,766 |  |  | 0 | 
| Ending balance (in shares) at Dec. 31, 2021 |  |  | 150,847 |  |  |  |  | 
| Ending balance at Dec. 31, 2021 | 4,046,756 | 4,048,527 |  | 2,181,025 | 1,943,981 | (76,479) | (1,771) | 
| Increase (Decrease) in Stockholders' Equity |  |  |  |  |  |  |  | 
| Net income attributable to KLA | 730,572 |  |  |  |  |  |  | 
| Net income attributable to non-controlling interest | 88 |  |  |  |  |  | 88 | 
| Other comprehensive income (loss) | 4,946 | 4,946 |  |  |  | 4,946 |  | 
| Net issuance under employee stock plans (in shares) |  |  | 67 |  |  |  |  | 
| Net issuance under employee stock plans | (16,661) | (16,661) |  | (16,661) |  |  |  | 
| Repurchase of common stock (in shares) |  |  | (1,539) |  |  |  |  | 
| Repurchase of common stock | (564,666) | (564,666) |  | (22,222) | (542,444) |  |  | 
| Cash dividends and dividend equivalents declared | (159,498) | (159,498) |  |  | (159,498) |  |  | 
| Stock-based compensation expense | 37,087 | 37,087 |  | 37,087 |  |  |  | 
| Ending balance (in shares) at Mar. 31, 2022 |  |  | 149,375 |  |  |  |  | 
| Ending balance at Mar. 31, 2022 | 4,078,624 | 4,080,307 |  | 2,179,229 | 1,972,611 | (71,533) | (1,683) | 
| Beginning balance (in shares) at Jun. 30, 2022 |  |  | 141,804 |  |  |  |  | 
| Beginning balance at Jun. 30, 2022 | 1,399,090 | 1,401,351 |  | 1,061,940 | 366,882 | (27,471) | (2,261) | 
| Increase (Decrease) in Stockholders' Equity |  |  |  |  |  |  |  | 
| Net income attributable to KLA | 1,025,991 | 1,025,991 |  |  | 1,025,991 |  |  | 
| Net income attributable to non-controlling interest | 74 |  |  |  |  |  | 74 | 
| Other comprehensive income (loss) | (31,370) | (31,370) |  |  |  | (31,370) |  | 
| Net issuance under employee stock plans (in shares) |  |  | 171 |  |  |  |  | 
| Net issuance under employee stock plans | (54,950) | (54,950) |  | (54,950) |  |  |  | 
| Repurchase of common stock (in shares) |  |  | (257) |  |  |  |  | 
| Repurchase of common stock | (89,616) | (89,616) |  | (1,926) | (87,690) |  |  | 
| Cash dividends and dividend equivalents declared | (186,216) | (186,216) |  |  | (186,216) |  |  | 
| Stock-based compensation expense | 34,982 | 34,982 |  | 34,982 |  |  |  | 
| Purchase of non-controlling interest | (4,294) | 1,902 |  | 1,902 |  |  | (6,196) | 
| Disposal of non-controlling interest | 8,383 |  |  |  |  |  | 8,383 | 
| Ending balance (in shares) at Sep. 30, 2022 |  |  | 141,718 |  |  |  |  | 
| Ending balance at Sep. 30, 2022 | 2,102,074 | 2,102,074 |  | 1,041,948 | 1,118,967 | (58,841) | 0 | 
| Beginning balance (in shares) at Jun. 30, 2022 |  |  | 141,804 |  |  |  |  | 
| Beginning balance at Jun. 30, 2022 | 1,399,090 | 1,401,351 |  | 1,061,940 | 366,882 | (27,471) | (2,261) | 
| Increase (Decrease) in Stockholders' Equity |  |  |  |  |  |  |  | 
| Net income attributable to KLA | 2,702,623 |  |  |  |  |  |  | 
| Net income attributable to non-controlling interest | 74 |  |  |  |  |  |  | 
| Other comprehensive income (loss) | (7,820) |  |  |  |  |  |  | 
| Repurchase of common stock (in shares) |  |  | (4,913) |  |  |  |  | 
| Repurchase of common stock | (943,310) |  |  |  |  |  |  | 
| Ending balance (in shares) at Mar. 31, 2023 |  |  | 137,289 |  |  |  |  | 
| Ending balance at Mar. 31, 2023 | 2,682,781 | 2,682,781 |  | 1,996,773 | 721,299 | (35,291) | 0 | 
| Beginning balance (in shares) at Sep. 30, 2022 |  |  | 141,718 |  |  |  |  | 
| Beginning balance at Sep. 30, 2022 | 2,102,074 | 2,102,074 |  | 1,041,948 | 1,118,967 | (58,841) | 0 | 
| Increase (Decrease) in Stockholders' Equity |  |  |  |  |  |  |  | 
| Net income attributable to KLA | 978,795 | 978,795 |  |  | 978,795 |  |  | 
| Other comprehensive income (loss) | 9,739 | 9,739 |  |  |  | 9,739 |  | 
| Net issuance under employee stock plans (in shares) |  |  | 170 |  |  |  |  | 
| Net issuance under employee stock plans | 31,196 | 31,196 |  | 31,196 |  |  |  | 
| Repurchase of common stock (in shares) |  |  | (3,429) |  |  |  |  | 
| Repurchase of common stock | (370,982) | (370,982) |  | 870,811 | (1,241,793) |  |  | 
| Cash dividends and dividend equivalents declared | (185,967) | (185,967) |  |  | (185,967) |  |  | 
| Stock-based compensation expense | 38,405 | 38,405 |  | 38,405 |  |  |  | 
| Ending balance (in shares) at Dec. 31, 2022 |  |  | 138,459 |  |  |  |  | 
| Ending balance at Dec. 31, 2022 | 2,603,260 | 2,603,260 |  | 1,982,360 | 670,002 | (49,102) | 0 | 
| Increase (Decrease) in Stockholders' Equity |  |  |  |  |  |  |  | 
| Net income attributable to KLA | 697,837 | 697,837 |  |  | 697,837 |  |  | 
| Net income attributable to non-controlling interest | 0 |  |  |  |  |  |  | 
| Other comprehensive income (loss) | 13,811 | 13,811 |  |  |  | 13,811 |  | 
| Net issuance under employee stock plans (in shares) |  |  | 57 |  |  |  |  | 
| Net issuance under employee stock plans | (16,154) | (16,154) |  | (16,154) |  |  |  | 
| Repurchase of common stock (in shares) |  |  | (1,227) |  |  |  |  | 
| Repurchase of common stock | (482,712) | (482,712) |  | (17,563) | (465,149) |  |  | 
| Cash dividends and dividend equivalents declared | (181,391) | (181,391) |  |  | (181,391) |  |  | 
| Stock-based compensation expense | 48,130 | 48,130 |  | 48,130 |  |  |  | 
| Ending balance (in shares) at Mar. 31, 2023 |  |  | 137,289 |  |  |  |  | 
| Ending balance at Mar. 31, 2023 | $ 2,682,781 | $ 2,682,781 |  | $ 1,996,773 | $ 721,299 | $ (35,291) | $ 0 |