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". The landlord can send out a termination confirmation that aligns with the notice period.
The notice period is slightly different, depending on if the premises is originally a lease (Hyresrätt) or if the landlord owns the apartment (Bostadsrätt).
Condominium (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 (i.e. the tenant cancels the agreement on January 10 so it ends with effect last February)
Tenancy (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 January 10 so it ends with effect last April)
If both parties agree, however at the time of termination of having a different notice period, one can in practice ignore the termination period.