Please note that GPS units do not always provide accurate directions to or within Yosemite. Yosemite covers 1,200 square miles and does not have a single address. We do not recommend using GPS units for directions in and around Yosemite. If you do use a GPS unit, just keep in mind that if there's a conflict between what the road sign says and what your GPS unit says, the road sign is correct (and your GPS unit isn't).
Gas is available at Wawona, Crane Flat, and El Portal 24 hours per day with a credit card. Gas is no longer available in Tuolumne Meadows. Gas is not available in Yosemite Valley.
You may find maps of Yosemite and California useful, as well as mileages and driving times from Yosemite Valley to various points in California and Nevada [143 kb PDF].
Also, keep in mind that, some roads are closed from around November through May/June and that tire chains may be required on open roads from around October through April (depending on conditions). You can use public transportation to get to Yosemite all year.
Getting to Yosemite From the West and North
San Francisco/Bay area
Distance: 195 mi / 314 km
Take I-580 east to I-205 east to Highway 120 east (Manteca) or Highway 140 east (Merced) into Yosemite National Park.
Distance: 176 mi / 283 km
Time: 4 hours
Take Highway 99 south to Highway 120 east (Manteca) or Highway 140 east (Merced) into Yosemite National Park.
Reno & Lake Tahoe
Approximately June through October, conditions permitting
Distance: 218 mi / 351 km (Reno)
Time: 5 hours
Take US 395 south to Lee Vining; take Highway 120 west into Yosemite National Park (open late May/June through October, depending on conditions).
Distance: 315 mi / 507 km (Reno)
Time: 8 hours
Take I-80 or I-50 west to Sacramento; take Highway 99 south to Highway 120 east (Manteca) or Highway 140 east (Merced) into Yosemite National Park.