The nearest international airport is Frankfurt Airport (FRA, not to be confused with HHN). Being the fourth-largest airport in Europe, there are regular direct flights or good connections from nearly any place in Europe or the world.
Frankfurt Airport has two distinct railway stations, one for long-distance trains (Frankfurt Flughafen Fernbahnhof) and one for regional trains (Frankfurt Flughafen Regionalbahnhof). From the long-distance train station, there are regular connections to Heidelberg during the day, the fastest connections taking about 50 minutes. You will need to change trains once. The fastest option is to take a high-speed train (ICE) to Mannheim, and then change to a S-train to Heidelberg. See the rail section below for notes on the S-train. Depending on the exact connection, this costs up to 30 EUR per direction. From the regional train station, you can reach Heidelberg with train or bus-train connections that take about 1hour and 50 minutes and cost 13 to 22 EUR.
You can check train connections and buy tickets (see notes below at „By train“) at the DB website. You’ll want to use the station “Frankfurt(M)Flughafen”.
The long-distance bus company Flixbus operates direct connections from the airport to Heidelberg up to 20 times a day. They sell tickets from 7 EUR upwards to 18 EUR depending on availability, but only if booked via their website or app, it is always the maximum price when bought from the driver. You can check connections at the Flixbux website.
Keep in mind while planning that Frankfurt Airport is a large airport and getting from your gate to the train or bus station might take you some time.
Stuttgart airport (STR) is also not that far away, but smaller and less well-connected by train. It is more expensive and takes longer to get to Heidelberg from there by train, but there are also direct bus connections by Flixbus.
Karlsruhe/Baden-Baden airport (FKB) is a small airport in the area that sometimes features cheap connections with budget airlines. It is a more cumbersome to get to Heidelberg from there, as you will need both buses and trains.
There are some (but only a few) long-distance trains that stop in Heidelberg. However, Heidelberg is very close to Mannheim, which is very well-connected by high-speed trains train to all parts of Germany as well as many places in the Netherlands, France, Switzerland, and Austria.
Once in Mannheim, there are several regional (red “S”- and “RE”-type trains) trains to Heidelberg, running six times an hour during the day. Depending on the type of train, they take between 11 and 17 minutes to reach Heidelberg. There are a few things important to know about these trains since not all announcements are repeated in English: The trains normally go to destinations beyond Heidelberg, therefore the direction on their signs often says Karlsruhe, Bruchsal, Osterburken, Heilbronn, or others. Heidelberg should appear on the platform signs as well, otherwise check the departure timetable for more information. The trains often consist of two or three coaches with different destinations. They will then be split up in Heidelberg Central and go to different places from there. However, in all cases, all cars will go to Heidelberg Central. There are other stops called “Heidelberg-something” on the line. The central station is called “Heidelberg Hbf”. If in doubt, ask a local. Most people around you will understand and speak English.
You can check railway connections and book tickets at the DB website.
Those trains can be used both with a DB ticket as well as a VRN public transport ticket. If you are using a train to get to Mannheim, we recommend to book your ticket including the connection to Heidelberg. In this case, it costs little to nothing extra. If you buy a standalone ticket Mannheim–Heidelberg, you will need a VRN public transport ticket of “Price level 4” which currently costs 5.60 EUR. Tickets can not be bought on board of the train, you will need to get one beforehand. There are red ticket machines by DB that sell both DB and VRN tickets and take cash, credit cards and some debit cards (girocard/Maestro/V-Pay).
The electronic displays outside and inside of the trains are notoriously broken and might show none or false information. The electronic displays on the platform are usually correct. If in doubt, ask a local or a DB staff member.
Heidelberg and Mannheim share their tram and bus network and there is a tram that goes from Mannheim to Heidelberg (route “5”). However, it is much slower than the DB trains and can not be used with a DB ticket, only with a VRN ticket of the same price level as for the train (Price level 4).
Note that Deutsche Bahn might offer you two prices: “Savings fare”/”Sparpreis” as well as the “Flexpreis”. The first one can be much cheaper if you book early (its availability is limited), but your ticket will only be valid for the exact train that is printed on your ticket. The Flexpreis is more expensive, but always available and valid on any train on the specified route on the date that is printed on the ticket.