The drive from Kansas City, Missouri, to San Francisco, California, via I-40 West and I-5 South takes approximately 20 hours and 45 minutes.