Sweden - Formatting standards & code snippets
Here is a complete list of standards and formats used in Sweden. It includes a full list of ISO codes, number, date, currency, telephone and address formats. You will also get code examples on how to perform the most common formatting operations in Java, C#, JavaScript and PHP. Multiple resource files are made available, mainly the complete list of states, in different formats such as CSV, XML, JSON, HTML and SQL.
What are the ISO-3166-1 codes for Sweden?
- Alpha-2: SE
- Alpha-3: SWE
- Numeric: 752
- Java Locale Code: sv_SE
- .Net CultureInfo Code: sv-SE
- PHP Locale Code: sv_SE
What is the official language in Sweden?
- Swedish
What is the date format in Sweden?
The date format in Sweden is big-endian:
- Format: yyyy-mm-dd
Ex: 2014-12-03 for December 3rd 2014
Formatting a date in Java:
Locale locale = new Locale("sv", "SE");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", locale);
sdf.format(new Date());
Formatting a date in C#:
CultureInfo ci = CultureInfo.GetCultureInfo("sv-SE");
DateTime.Now.ToString("yyyy-MM-dd", ci);
Formatting a date in JavaScript:
let date = new Date();
date.toLocaleDateString('sv-SE');
Formatting a date in PHP:
date("Y-m-d");
What is the time format in Sweden?
The time format in Sweden is 24-hour notation in most cases.
- Format: HH:mm[:ss]
Ex: 09:00 for 09:00AM, and 21:00 for 09:00PM
Formatting time in Java:
Locale locale = new Locale("sv", "SE");
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", locale);
sdf.format(new Date());
Formatting time in C#:
CultureInfo ci = CultureInfo.GetCultureInfo("sv-SE");
DateTime.Now.ToString("HH:mm:ss", ci);
Formatting time in JavaScript:
let time = new Date();
date.toLocaleTimeString('sv-SE');
Formatting time in PHP:
date("H:i:s");
What is the numeric format in Sweden?
- Format: 999 999 999,99
- Group Size: 3
- Grouping Character: space
- Decimal Character: , (comma)
Formatting numbers in Java:
Locale locale = new Locale("sv", "SE");
NumberFormat numberFormat = NumberFormat.getNumberInstance(locale);
numberFormat.format(999999999.99d);
Formatting numbers in C#:
double d = 999999999.99d;
d.ToString("n", CultureInfo.GetCultureInfo("sv-SE")));
Formatting numbers in JavaScript:
let number = 999999999.99;
number.toLocaleString('sv-SE');
Formatting numbers in PHP:
$fmt = new NumberFormatter($locale = 'sv_SE', NumberFormatter::DECIMAL);
$fmt->format(999999999.99);
What is the currency format in Sweden?
- Format: 999.999.999,00 kr
- Group Size: 3
- Grouping Character: . (dot)
- Decimal Character: , (comma)
- Currency Symbol: kr
- Currency Symbol Position: After number
- Currency Name: Swedish Krona (SEK)
Formatting currency in Java:
Locale locale = new Locale("sv", "SE");
NumberFormat numberFormat = NumberFormat.getCurrencyInstance(locale);
numberFormat.format(999999999.99d);
Formatting currency in C#:
double d = 999999999.99d;
d.ToString("c", CultureInfo.GetCultureInfo("sv-SE")));
Formatting currency in JavaScript:
let number = 999999999.99;
number.toLocaleString('sv-Se', {currency: 'SEK', style: 'currency'});
Formatting currency in PHP:
$fmt = new NumberFormatter($locale = 'sv_SE', NumberFormatter::CURRENCY);
$fmt->format(999999999.99);
Download list of counties for Sweden in CSV, JSON, HTML, SQL and XML
List of counties: HTML - Select Control
------------------------
ISO_3166-2 code + name
------------------------
<select>
<option value="SE-K">Blekinge län</option>
<option value="SE-W">Dalarnas län</option>
<option value="SE-I">Gotlands län</option>
<option value="SE-X">Gävleborgs län</option>
<option value="SE-N">Hallands län</option>
<option value="SE-Z">Jämtlands län</option>
<option value="SE-F">Jönköpings län</option>
<option value="SE-H">Kalmar län</option>
<option value="SE-G">Kronobergs län</option>
<option value="SE-BD">Norrbottens län</option>
<option value="SE-M">Skåne län</option>
<option value="SE-AB">Stockholms län</option>
<option value="SE-D">Södermanlands län</option>
<option value="SE-C">Uppsala län</option>
<option value="SE-S">Värmlands län</option>
<option value="SE-AC">Västerbottens län</option>
<option value="SE-Y">Västernorrlands län</option>
<option value="SE-U">Västmanlands län</option>
<option value="SE-O">Västra Götalands län</option>
<option value="SE-T">Örebro län</option>
<option value="SE-E">Östergötlands län</option>
</select>
List of counties: CSV
code,name
SE-K,"Blekinge län"
SE-W,"Dalarnas län"
SE-I,"Gotlands län"
SE-X,"Gävleborgs län"
SE-N,"Hallands län"
SE-Z,"Jämtlands län"
SE-F,"Jönköpings län"
SE-H,"Kalmar län"
SE-G,"Kronobergs län"
SE-BD,"Norrbottens län"
SE-M,"Skåne län"
SE-AB,"Stockholms län"
SE-D,"Södermanlands län"
SE-C,"Uppsala län"
SE-S,"Värmlands län"
SE-AC,"Västerbottens län"
SE-Y,"Västernorrlands län"
SE-U,"Västmanlands län"
SE-O,"Västra Götalands län"
SE-T,"Örebro län"
SE-E,"Östergötlands län"
List of counties: JSON
------------------------
ISO-3166-2 code + Name
------------------------
[
{code: "SE-K", name: "Blekinge län"},
{code: "SE-W", name: "Dalarnas län"},
{code: "SE-I", name: "Gotlands län"},
{code: "SE-X", name: "Gävleborgs län"},
{code: "SE-N", name: "Hallands län"},
{code: "SE-Z", name: "Jämtlands län"},
{code: "SE-F", name: "Jönköpings län"},
{code: "SE-H", name: "Kalmar län"},
{code: "SE-G", name: "Kronobergs län"},
{code: "SE-BD", name: "Norrbottens län"},
{code: "SE-M", name: "Skåne län"},
{code: "SE-AB", name: "Stockholms län"},
{code: "SE-D", name: "Södermanlands län"},
{code: "SE-C", name: "Uppsala län"},
{code: "SE-S", name: "Värmlands län"},
{code: "SE-AC", name: "Västerbottens län"},
{code: "SE-Y", name: "Västernorrlands län"},
{code: "SE-U", name: "Västmanlands län"},
{code: "SE-O", name: "Västra Götalands län"},
{code: "SE-T", name: "Örebro län"},
{code: "SE-E", name: "Östergötlands län"}
]
List of counties: SQL
-- -----------------------------------------------------
-- Table `county`
-- -----------------------------------------------------
DROP TABLE IF EXISTS county;
CREATE TABLE IF NOT EXISTS county (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
code VARCHAR(6) NOT NULL,
name VARCHAR(50) NOT NULL
PRIMARY KEY (id),
UNIQUE INDEX id_UNIQUE (id ASC),
UNIQUE INDEX code_UNIQUE (code ASC)
) ENGINE = InnoDB;
INSERT INTO county (id, code, name) VALUES (null, 'SE-K', 'Blekinge län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-W', 'Dalarnas län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-I', 'Gotlands län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-X', 'Gävleborgs län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-N', 'Hallands län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-Z', 'Jämtlands län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-F', 'Jönköpings län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-H', 'Kalmar län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-G', 'Kronobergs län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-BD', 'Norrbottens län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-M', 'Skåne län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-AB', 'Stockholms län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-D', 'Södermanlands län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-C', 'Uppsala län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-S', 'Värmlands län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-AC', 'Västerbottens län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-Y', 'Västernorrlands län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-U', 'Västmanlands län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-O', 'Västra Götalands län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-T', 'Örebro län');
INSERT INTO county (id, code, name) VALUES (null, 'SE-E', 'Östergötlands län');
List of counties: XML
<!-- ISO 3166-2 code + name -->
<?xml version="1.0" encoding="UTF-8"?>
<counties>
<county>
<code>SE-K</code>
<name>Blekinge län</name>
</county>
<county>
<code>SE-W</code>
<name>Dalarnas län</name>
</county>
<county>
<code>SE-I</code>
<name>Gotlands län</name>
</county>
<county>
<code>SE-X</code>
<name>Gävleborgs län</name>
</county>
<county>
<code>SE-N</code>
<name>Hallands län</name>
</county>
<county>
<code>SE-Z</code>
<name>Jämtlands län</name>
</county>
<county>
<code>SE-F</code>
<name>Jönköpings län</name>
</county>
<county>
<code>SE-H</code>
<name>Kalmar län</name>
</county>
<county>
<code>SE-G</code>
<name>Kronobergs län</name>
</county>
<county>
<code>SE-BD</code>
<name>Norrbottens län</name>
</county>
<county>
<code>SE-M</code>
<name>Skåne län</name>
</county>
<county>
<code>SE-AB</code>
<name>Stockholms län</name>
</county>
<county>
<code>SE-D</code>
<name>Södermanlands län</name>
</county>
<county>
<code>SE-C</code>
<name>Uppsala län</name>
</county>
<county>
<code>SE-S</code>
<name>Värmlands län</name>
</county>
<county>
<code>SE-AC</code>
<name>Västerbottens län</name>
</county>
<county>
<code>SE-Y</code>
<name>Västernorrlands län</name>
</county>
<county>
<code>SE-U</code>
<name>Västmanlands län</name>
</county>
<county>
<code>SE-O</code>
<name>Västra Götalands län</name>
</county>
<county>
<code>SE-T</code>
<name>Örebro län</name>
</county>
<county>
<code>SE-E</code>
<name>Östergötlands län</name>
</county>
</counties>