Most water heaters have their date of manufacture on them, but you can also find the date from the serial number, see here for water-heater-age-decoder code!
Nobody wants to throw out working equipment, but we also don't want our water heater to fail and flood the house, or to keep on poisoning the planet. When should you replace your water heater?
If your water heater is more than 10 years old, you should definitely plan to replace it soon. Gas heaters last about 10-12 years, less if you don't do regular maintenace. When they fail, it's often sudden, sometimes catastrophic. Flood damage costs an average of $3,300 to repair (nationwide; probably more in San Mateo). Scheduling a replacement is a lot less stress than having to do it after your water heater fails.
But it actually makes sense to replace much younger water heaters. Gas water heaters cost about $3,000 to replace in San Mateo county (Home Blue), so they cost about $300 per year of life. After rebates, your new heat pump water heater will likely cost about $1,750, so replacing even a six-year old water heater would let you break even immediately, not to mention the ~$200 per year you'll save on utility bills. There's also an issue of how long rebates will last. The very high current PCE rebates is likely focused on getting people started on making the switch, but may not last once electrification becomes the norm. California plans to ban sale of new gas-powered appliances starting in 2030, and the Bay Area in 2027, so if you have a newish gas heater, your next one will probably be a heat pump anyhow.
And of course, there are the emissions. Every year, your gas heater belches out 3,880 pounds of CO2. Coupled with all the methane leaks and unburned gas, that adds up to the equivalent of 6,200 pounds of CO2, no matter how old your water heater is. Since you'll be saving money by going electric anyhow, why not do it now, and avoid the hassle of an emergency failure, and the ongoing pollution of your current water heater?
Back to the San Mateo County Guide to Climate-Friendly Water Heating.