If you wish to terminate your lease early you have to inform your landlord, who will be able to send out a termination confirmation under "Rentals" and "Details". When terminating a lease you need to follow the notice period which is regulated by Swedish rental law unless you and the landlord have agreed on something else.
The notice period is slightly different, depending if the premises is originally a lease (Hyresrätt) or if the landlord owns the apartment (Bostadsrätt).
Owned apartment (Bostadsrätt, Villa) - This Act (2012: 978) on the letting of own residence (§ 3).
The tenant has one month's notice,
The landlord has 3 months notice.
* Note that it is the end of the month that counts (ie the tenant cancels the agreement on the 10th of January it ends with effect last February)
Leased apartment (Hyresrätt) - here comes the so-called Tenancy Act (ie Chapter 12. Of the Land Code). The same notice period applies to both the landlord and tenant,
One day of rental is at two weeks
1 week of rental is up to three months
Three months if the lease is extended three months
* Note that it is the end of the month that counts (ie say one part cancels the agreement on 10th of January it ends with effect last April)
Provisions of notice is regulated by law and can not be derogated from (it does not matter what you write in the contract). If both parties agree, however at the time of termination of having a different notice period, one can in practice have a different notice period.