German uses the preposition an for places where you are right next to an edge, a line or a surface: the beach, the border, the wall, the window, the corner. You lie am Strand, you wait an der Grenze, a picture hangs an der Wand, and you meet a friend an der Ecke.
English speakers find this tricky because English spreads these places across several prepositions: on the beach, at the border, on the wall, by the window. So learners often reach for auf or bei. In German, one small word covers the whole group.
Word list
ComputermA1computeram Computer = at/on the computerFensternA1windowam Fenster = by the windowFeuernA1fiream Feuer = by the fireFlughafenmA1airportam Flughafen = at the airportFlussmA1riveram Fluss = by the riverMeernA1seaans Meer = to the seasidePCmA1computeram PC = on the PCSchreibtischmA1deskam Schreibtisch = at the deskSeemA1lakeam See = by the lakeStationfA1stationan der Station = at the stopStrandmA1beacham Strand = on the beachTelefonnA1phoneam Telefon = on the phoneTischmA1tableam Tisch = at the tableTürfA1dooran der Tür = at the doorWandfA1wallan der Wand = on the wallAtlantischer OzeanmA2Atlantic Oceanam Atlantischen Ozean = on the AtlanticAusgangmA2exitam Ausgang = at the exitBackofenmA2ovenam Backofen = at the ovenBahnhofmA2railway stationam Bahnhof = at the stationBushaltestellefA2bus stopan der Bushaltestelle = at the bus stopDeckefA2ceilingan der Decke = from the ceilingEingangmA2entranceam Eingang = at the entranceGrenzefA2borderan der Grenze = at the borderHaltestellefA2bus stopan der Haltestelle = at the bus stopIndischer OzeanmA2Indian Oceanam Indischen Ozean = on the Indian OceanKüstefA2coastan der Küste = on the coastOfenmA2ovenam Ofen = by the stoveOzeanmA2oceanam Ozean = by the oceanPazifischer OzeanmA2Pacific Oceanam Pazifischen Ozean = on the PacificRechnermA2computeram Rechner = at the computerThekefA2counteran der Theke = at the counter/barAmpelfB1traffic lightan der Ampel = at the traffic lightsBachmB1streamam Bach = by the streamBahnsteigmB1platformam Bahnsteig = on the platformBildschirmmB1screenam Bildschirm = at a screenBrunnenmB1wellam Brunnen = at the well/fountainEckefB1corneran der Ecke = on the cornerEingangstürfB1front dooran der Eingangstür = at the front doorEmpfangmB1front deskam Empfang = at the front deskFahrkartenschaltermB1ticket officeam Fahrkartenschalter = at the ticket officeHafenmB1portam Hafen = at/by the harbourHaustürfB1front dooran der Haustür = at the front doorHerdmB1stoveam Herd = at the stoveKanalmB1canalam Kanal = by the canalKreuzungfB1intersectionan der Kreuzung = at the junctionKüchenspülefB1kitchen sinkan der Küchenspüle = at the kitchen sinkLaptopmB1laptopam Laptop = on the laptopMauerfB1wallan der Mauer = by/on the wallMonitormB1monitoram Monitor = at the monitorRandmB1edgeam Rand der Stadt = on the edge of townRezeptionfB1front deskan der Rezeption = at receptionSchaltermB1counteram Schalter = at the counterSpülefB1kitchen sinkan der Spüle = at the sinkTafelfB1blackboardan der Tafel = on the boardTicketschaltermB1ticket officeam Ticketschalter = at the ticket officeTornB1gateam Tor = at the gateWaschbeckennB1washbasinam Waschbecken = at the basinWasserfallmB1waterfallam Wasserfall = at the waterfallZimmerdeckefB1ceilingan der Zimmerdecke = on the ceilingArktischer OzeanmB2Arctic Oceanam Arktischen Ozean = on the Arctic OceanBankautomatmB2cash machineam Bankautomaten = at the ATMBankomatmB2cash machineam Bankomaten = at the ATMFußgängerüberwegmB2pedestrian crossingam Fußgängerüberweg = at the pedestrian crossingGeldautomatmB2cash machineam Geldautomaten = at the cash machineGolfmB2bayam Golf von Mexiko = on the Gulf of MexicoLagerfeuernB2campfiream Lagerfeuer = by the campfireMittelmeernB2Mediterranean Seaam Mittelmeer = on the MediterraneanNordpolmB2North Poleam Nordpol = at the North PolePultnB2deskam Pult = at the desk/lecternSpülbeckennB2kitchen sinkam Spülbecken = at the sinkStraßenkreuzungfB2intersectionan der Straßenkreuzung = at the crossroadsSüdlicher OzeanmB2Southern Oceanam Südlichen Ozean = on the Southern OceanSüdpolmB2South Poleam Südpol = at the South PoleSüdpolarmeernB2Southern Oceanam Südpolarmeer = on the Southern OceanTeichmB2pondam Teich = by the pondTresenmB2counteram Tresen = at the counter/barUfernB2bankam Ufer = on the bankVordertürfB2front dooran der Vordertür = at the front doorZebrastreifenmB2pedestrian crossingam Zebrastreifen = at the zebra crossingÄquatormC1equatoram Äquator = on the equatorHorizontmC1horizonam Horizont = on the horizonKaminmC1fireplaceam Kamin = by the fireplaceKassefC1cash registeran der Kasse = at the tillRegistrierkassefC1cash registeran der Registrierkasse = at the tillTalsperrefC1daman der Talsperre = at the damDonaufC2Danubean der Donau = on the DanubeRheinmC2Rhineam Rhein = on the Rhine
How it works
Think of an as meaning right beside something, touching its edge. The thing has a side, a line or a front, and you are at that side. You are not on top of it and not inside it.
Like other two-way prepositions, an takes the dative for location (where?) and the accusative for movement towards a place (where to?). With masculine and neuter nouns, an dem almost always shortens to am, and an das shortens to ans.
Where? am Meer, am Fluss, an der Küste
Where to? ans Meer, an den Fluss, an die Küste
Im Sommer fahren wir ans Meer.
(In summer we go to the seaside.)
Ich hänge das Bild an die Wand.
(I'm hanging the picture on the wall.)
The words
Water and shores
Any place beside water takes an: Meer, Ozean, Mittelmeer, See, Teich, Fluss, Bach, and the edges themselves, Strand, Küste and Ufer. You go on holiday ans Mittelmeer, have a picnic am Bach and walk am Ufer.
Die Kinder spielen den ganzen Tag am Strand.
(The children play on the beach all day.)
Meine Großeltern wohnen direkt am See.
(My grandparents live right by the lake.)
Borders, walls and edges
Grenze, Wand, Mauer and Rand are lines or surfaces, so they take an as well: am Rand der Stadt means on the edge of town.
An der Grenze müssen wir unsere Pässe zeigen.
(We have to show our passports at the border.)
In a room
You sit am Fenster, am Tisch or am Schreibtisch, you stand an der Tür, and a pupil writes an der Tafel. In each case you are beside it, facing its surface.
Er sitzt am Fenster und liest.
(He's sitting by the window, reading.)
Um sieben sitzen wir alle am Tisch.
(At seven we're all sitting at the table.)
Points in town
The same goes for spots where you stop or queue: Ecke, Kreuzung, Ampel, Haltestelle, Bahnhof, Eingang, Ausgang, Theke, Kasse and Fahrkartenschalter. You meet am Eingang or am Bahnhof and order a drink an der Theke.
Wir treffen uns an der Ecke.
(We'll meet on the corner.)
Ich warte schon zehn Minuten an der Haltestelle.
(I've been waiting at the bus stop for ten minutes.)
An der Ampel musst du links abbiegen.
(Turn left at the traffic lights.)
Bitte bezahlen Sie an der Kasse.
(Please pay at the till.)
Watch out
These nouns do not always take an. The preposition describes where you are, so a different position needs a different word. Am See means on the shore, but out in a boat you are auf dem See. Am Meer is the seaside, but when you swim you are im Meer. The plate is auf dem Tisch, while the people are am Tisch. Some speakers even say auf dem Strand to stress the sandy surface, though am Strand is the everyday choice.
Das Boot ist mitten auf dem See.
(The boat is in the middle of the lake.)
Im Juli ist es warm genug, im Meer zu schwimmen.
(In July it's warm enough to swim in the sea.)
You will also hear an der Universität studieren or teach an einer Schule. That is a different use: it expresses belonging to an institution, not standing at its edge. Learn it separately.
Summary
If you are right beside something, at its shore, edge, side or front, use an: am Strand, an der Grenze, am Fenster, an der Kasse. Use the dative (am, an der) for where you are and the accusative (ans, an die) for where you are going. Switch to auf for on top and in for inside.