Citizens of EU countries can enter Sweden with a passport or a national identification card (passports are recommended) and stay up to three months. Nationals of Nordic countries (Denmark, Norway, Finland and Iceland) can stay and work indefinitely, but nationals of other countries require residence permits (uppehållstillstånd) for stays of between three months and five years; there is no fee for this permit for EU citizens.
Non-EU passport holders from Australia, New Zealand, Canada and the US can enter and stay in Sweden without a visa for up to three months. Australian and New Zealand passport holders aged between 18 and 30 can qualify for a one-year working-holiday visa.
Citizens of South Africa and many other African, Asian and some Eastern European countries require tourist visas for entry. These are only available in advance from Swedish embassies (allow two months); there's a nonrefundable application fee of Skr315. Visas last up to three months, and extensions aren't easily obtainable.
Non-EU citizens can also obtain residence permits, but these must be applied for before entering Sweden. An interview by consular officials at your nearest Swedish embassy is required - allow up to eight months for this process. Foreign students are granted residence permits if they can prove acceptance by a Swedish educational institution and are able to guarantee that they can support themselves financially.