Skip to content

Instantly share code, notes, and snippets.

@cedendahlkim
Created July 26, 2026 05:32
Show Gist options
  • Select an option

  • Save cedendahlkim/55d7963009ce19fd5ef714d8cb6a1278 to your computer and use it in GitHub Desktop.

Select an option

Save cedendahlkim/55d7963009ce19fd5ef714d8cb6a1278 to your computer and use it in GitHub Desktop.
🇸🇪 Swedish Developer Cheat Sheet — personnummer, VAT, Bankgiro, public holidays, coordinates, all in one reference

🇸🇪 Swedish Developer Cheat Sheet

Everything you need to handle Swedish-specific data formats. Bookmark this.

Personnummer (Personal Identity Number)

Format: YYYYMMDD-XXXX (12 digits) or YYMMDD-XXXX (10 digits)

YYMMDD-XXXX
││││││ ││││
││││││ │││└─ Luhn checksum digit
││││││ ││└── Serial number (odd=male, even=female)
││││││ │└─── Serial number
││││││ └──── Serial number
││││└└────── Day (add 60 for coordination number)
│││└└─────── Month
│└└└──────── Year

Luhn algorithm: Multiply every other digit by 2, sum all digits, checksum = (10 - sum%10)%10

Coordination numbers: Day + 60 (e.g., person born on 15th → coordination number day = 75)

Century markers: - = 1900-1999, + = 2000-2099

Bankgiro

Format: NNN-NNNN or NNNNNNN (7-8 digits)

Validation: Mod-10 checksum on last digit

Multiply digits by 2,1,2,1,2,1,2 from right (skip checksum)
Sum all digits (products >9: subtract 9)
Valid if sum % 10 == 0

90-konto: Starts with 90 (charity accounts)

PlusGiro

Format: NNNNNN-N or NNNNNNN (7-8 digits)

Validation: Mod-10, same algorithm as Bankgiro

Organisationsnummer

Format: NNNNNN-NNNN (10 digits)

Same as personnummer but:

  • Middle digit of serial number ≥ 2 (not 0 or 1)
  • Month digits = 20+ for some types
  • Third digit indicates legal form:
    • 0: Dead estates
    • 1: Municipalities
    • 2: State/landsting
    • 3: Foreign companies
    • 5: Aktiebolag (AB)
    • 7: Ekonomisk förening
    • 9: Handelsbolag/Kommanditbolag

Swedish VAT (Moms)

Rate Applies to
25% Most goods and services (default)
12% Food, restaurants, hotels, camping
6% Books, newspapers, public transport, culture

Add VAT: amount * (1 + rate)
Extract VAT: amount * rate / (1 + rate)
Remove VAT: amount / (1 + rate)

Arbetsgivaravgift (Employer Contributions)

Standard rate: 31.42% of gross salary

Lower rates (2026):

  • 10.21% for persons born 2001-2006 (15-25 years)
  • 10.21% for persons born 1960 or later (66+ years)

Public Holidays 2026 (Röda dagar)

Date Name
Jan 1 Nyårsdagen
Jan 6 Trettondedag jul
Apr 3 LÃ¥ngfredagen
Apr 5 PÃ¥skdagen
Apr 6 Annandag påsk
May 1 Första maj
May 14 Kristi himmelsfärds dag
May 24 Pingstdagen
Jun 6 Nationaldagen
Jun 19 Midsommarafton
Jun 20 Midsommardagen
Nov 6 Alla helgons dag
Dec 24 Julafton
Dec 25 Juldagen
Dec 26 Annandag jul
Dec 31 Nyårsafton

Swedish Coordinates

System Domain
RT90 Older Swedish grid
SWEREF99 Modern Swedish grid
WGS84 GPS (global)

RT90 → WGS84: Complex 7-parameter Helmert transformation
SWEREF99 ↔ WGS84: Minimal offset (centimeters)

Postal Codes

Format: NNN NN (5 digits)

  • First two digits: geographic region
  • 10-19: Stockholm
  • 20-29: SkÃ¥ne
  • 30-49: Västra Götaland/SmÃ¥land
  • 50-69: Östergötland/Närke/Värmland
  • 70-89: Dalarna/Gävleborg/Norrland
  • 90-99: Västerbotten/Norrbotten

Phone Numbers

Prefix Type
07X Mobile (070=Telia, 073=Tele2, 076=Telenor, 079=Tre)
08 Stockholm area
031 Gothenburg
040 Malmö
020 Freephone
0900 Premium rate
112 Emergency

Currency Format

  • Symbol: kr (after amount: 100 kr)
  • Decimal separator: , (comma: 100,50 kr)
  • Thousands separator: space (10 000 kr)
  • ISO code: SEK

Curated by Gracestack • Open source tools at github.com/cedendahlkim • MIT licensed — copy, fork, share freely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment