Hoppsan translates as 'oops', or 'whoops' in English. But it's slightly less common, and in the same context a Swede might instead say oj, ojdå, or simply oops.
Hoppsan acknowledges that something unfortunate, often unintended and unexpected, has happened; something's gone wrong. But it also implies that the problem isn't a serious one.
It's about showing that there's been a mistake, and not about who's responsible, so you could say hoppsan whether it's you or someone else who's made the mishap.
It has an informal and jokey tone and you'll often hear it said to children in a cheerful way, “hoppsan!”, if they fall over or drop something, to reassure them that it's no big deal.
You'll also hear it among adults too, although less frequently. If you bump into a stranger, it would be more usual to say oj or förlåt (sorry) than the more friendly hoppsan.
Among adults, hoppsan might be a neutral (and informal) acknowledgement of an accident (hoppsan, jag tappade den – whoops, I dropped it) but it could also be used teasingly or sarcastically, to make fun of someone being accident-prone or to imply that something wasn't really an accident.
Expressions that sound a bit like hoppsan pop up frequently in European languages. As well as English 'oops', the French say oups, the Spanish say opa, and the Germans hoppla.
The -san ending is specific to Swedish, and it's a common addition to exclamations. For example, hejsan is an alternative way to say 'hello', and jajamensan, an emphatic agreement. Jajamensan has a different origin, but the -san in hejsan and hoppsan probably comes from a shortening of 'sade han' ('he said'). In spoken Swedish the -de ending of sade is often dropped to become 'sa han'.
Hoppsan, det tänkte jag inte på
Whoops, I didn't think about that
Hoppsan, jag råkade köpa nya skor!
Oops, I managed to buy more shoes