The city is located in the Catalan Prelitoral depression (Depressió Prelitoral), at the feet of the Prelitoral mountain range (Natural reserve of Sant Llorenç del Munt) and the average altitude of the city is 277 meters above sea level.
It is 20 and 18 kilometres from Barcelona and Montserrat respectively.
Terrassa originated as the Roman town of Egara (Municipium Flavium Egara), which was founded during the time of the emperor Vespasian (69-79 CE), alongside the torrent of Vallparadís (nowadays an urban park) close to the Iberian town of Egosa, on the site of which some ceramics and coins have been found.
Other important remains from the Middle Ages are the former cathedral, the castle of Vallparadís (from 1344 to 1413 a Carthusian monastery and today a municipal museum) and the tower of the castle-palace of the count-king).
In 2005, during the construction of a tunnel for one of the city's railway lines, a prehistoric site was found in the Park of Vallparadís , with stone tools and fossils of hunted animals dating back 800,000 to 1,000,000 years, making this is one of the oldest prehistoric sites in Europe.The episcopal see of Ègara already existed by about 450 CE, when it was established on territory split off from the Roman Catholic Diocese of Barcelona, under the Metropolitan Archdiocese of Tarragona.Pope Hilarius confirmed its autonomy be denying a request around 469 to unite it with the Barcelona under its own first bishop, Ireneus.) is a city in the east central region of Catalonia, in the province of Barcelona, comarca of Vallès Occidental, of which it is the cocapital along with Sabadell.It is the site of Roman Egara, a former Visigothic bishopric, which became a Latin Catholic titular see.Recently FGC extended its line to the north of the city, building three new stations; one of them acts as a rail hub with the RENFE line. Several interurban bus lines connect Terrassa with the closest cities and towns such as Sabadell, Castellar del Vallès, Martorell, Rubí, Sant Cugat del Vallès and Vacarisses.