| Cash, and Cash Equivalents, Marketable Securities, and Restricted Cash |
Cash, Cash Equivalent, Marketable Securities, and Restricted Cash The following table sets forth cash, cash equivalents, marketable securities and restricted cash (in millions): | | | | | | | | | | | | | December 31, | | 2022 | | 2021 | | Cash and cash equivalents: | | | | | Cash | $ | 6,176 | | | $ | 7,308 | | | Money market funds | 8,305 | | | 8,850 | | | U.S. government securities | — | | | 25 | | | U.S. government agency securities | 16 | | | 108 | | | Certificates of deposit and time deposits | 156 | | | 250 | | | Corporate debt securities | 28 | | | 60 | | | Total cash and cash equivalents | 14,681 | | | 16,601 | | | Marketable securities: | | | | | Marketable debt securities: | | | | | U.S. government securities | 8,708 | | | 10,901 | | | U.S. government agency securities | 4,989 | | | 5,927 | | | Corporate debt securities | 12,335 | | | 14,569 | | | Total marketable debt securities | 26,032 | | | 31,397 | | | Marketable equity securities | 25 | | | — | | | Total marketable securities | 26,057 | | | 31,397 | | | Restricted cash: | | | | | Restricted cash included in prepaid expenses and other current assets | 294 | | | 149 | | | Restricted cash included in other assets | 621 | | | 115 | | | Total restricted cash | 915 | | | 264 | | | Total cash, cash equivalents, marketable securities, and restricted cash | $ | 41,653 | | | $ | 48,262 | |
The following table summarizes our available-for-sale marketable debt securities and cash equivalents with unrealized losses as of December 31, 2022 and 2021, aggregated by major security type and the length of time that individual securities have been in a continuous loss position (in millions): | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | December 31, 2022 | | Less than 12 months | | 12 months or greater | | Total | | Fair Value | | Unrealized Losses | | Fair Value | | Unrealized Losses | | Fair Value | | Unrealized Losses | | U.S. government securities | $ | 5,008 | | | $ | (234) | | | $ | 3,499 | | | $ | (247) | | | $ | 8,507 | | | $ | (481) | | | U.S. government agency securities | 524 | | | (17) | | | 4,415 | | | (308) | | | 4,939 | | | (325) | | | Corporate debt securities | 4,555 | | | (249) | | | 7,256 | | | (634) | | | 11,811 | | | (883) | | | Total | $ | 10,087 | | | $ | (500) | | | $ | 15,170 | | | $ | (1,189) | | | $ | 25,257 | | | $ | (1,689) | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | December 31, 2021 | | Less than 12 months | | 12 months or greater | | Total | | Fair Value | | Unrealized Losses | | Fair Value | | Unrealized Losses | | Fair Value | | Unrealized Losses | | U.S. government securities | $ | 5,184 | | | $ | (38) | | | $ | 30 | | | $ | — | | | $ | 5,214 | | | $ | (38) | | | U.S. government agency securities | 5,029 | | | (61) | | | 2 | | | — | | | 5,031 | | | (61) | | | Corporate debt securities | 10,041 | | | (93) | | | 40 | | | (1) | | | 10,081 | | | (94) | | | Total | $ | 20,254 | | | $ | (192) | | | $ | 72 | | | $ | (1) | | | $ | 20,326 | | | $ | (193) | |
The increase in the gross unrealized losses for the year ended December 31, 2022 is due to higher interest rates. The allowance for credit losses and the gross unrealized gains on our marketable debt securities was not material as of December 31, 2022 and 2021.
The following table classifies our marketable debt securities by contractual maturities (in millions): | | | | | | | | | December 31, 2022 | | | | Due within one year | $ | 4,170 | | | | | Due after one year to five years | 21,862 | | | | | Total | $ | 26,032 | | | |
|