Niles Canyon is a canyon in the San Francisco Bay Area formed by Alameda Creek. The canyon is largely in an unincorporated area of Alameda County, while the western portion of the canyon lies within the city limits of Fremont and Union City. The stretch of State Route 84 known as Niles Canyon Road traverses the length of the canyon from the Fremont district of Niles to the unincorporated town of Sunol. Two railroads also follow the same route down the canyon from Sunol to Niles: the old Southern Pacific track along the north side and the newer Union Pacific (formerly the Western Pacific) track a little to the south. At the west end are the ruins of the Vallejo Mill, which goes back to pre-American California.
At the canyon's western mouth, Essanay Film Company had a studio located in Niles from 1912 1916, where Charlie Chaplin made The Tramp and a few other films in early 1915. The canyon itself was the setting for a number of early films.
The route of El Camino Viejo came through Niles Canyon.
The Union Pacific Railroad (formerly Western Pacific Railroad) has an active mainline through the Canyon. The Altamont Commuter Express runs along this line on weekdays. The former Southern Pacific route from Oakland to Tracy via Niles Canyon is now abandoned, except for the portion from Sunol to Niles Station operated by the heritage railway known as the Niles Canyon Railway. This line had been the original extension of the First Transcontinental Railroad from Sacramento to San Francisco Bay and was completed in 1869, but lost its transcontinental traffic in 1879 to its shorter route through Benicia.