# Norwegian identifiers

## organisasjonsnummer (orgnr)

Nine digits, identifies a legal entity. Written `883409442` or `883 409 442`.

Carries a **mod-11 check digit**, so typos are detectable without a network
call — `norsk_resolve` validates it and tells you immediately. If a user gives
you a 9-digit number that fails the checksum, it is a typo, not a missing
company.

Every entity has one: companies, associations, foundations, sole
proprietorships, government bodies, and every registered branch (underenhet).

## underenhet vs. hovedenhet

A **hovedenhet** is the legal entity. An **underenhet** is one of its registered
business locations — a shop, a site, an office. Each underenhet has its own
distinct org number and points at its parent via `overordnetEnhet`.

This trips up headcount questions constantly: **employees are registered at the
underenhet**, so a large parent company frequently shows `antallAnsatte: 0` on
its own record.

## fødselsnummer (fnr) / d-nummer

Eleven digits, the personal ID of an individual. **Not available anywhere in
this server.** The open registers publish a person's name and date of birth for
registered roles, nothing more.

If asked for one, say it requires the authenticated Brønnøysund roles API with
an approved Maskinporten scope, which this server does not have. Do not attempt
to derive or guess one — the last five digits encode a checksum and gender, and
constructing one would be both wrong and inappropriate.

## gnr / bnr — cadastral property id

```
kommunenummer - gårdsnummer / bruksnummer [/ festenummer / seksjonsnummer]
```

Unique **only within a municipality**, so always carry the kommunenummer
alongside. See the `eiendom` guide.

## kommunenummer

Four digits identifying a municipality. Common ones:

| Number | Municipality |
|---|---|
| 0301 | Oslo |
| 4601 | Bergen |
| 5001 | Trondheim |
| 1103 | Stavanger |
| 3301 | Drammen |
| 1002 | Kristiansand (see caveat) |

**These were renumbered.** Norway merged municipalities in 2020 and adjusted
again in 2024 when several merged counties split back apart. Old four-digit
codes appear in historical data and no longer resolve. If a code returns
nothing, that is the likely cause — search by municipality *name* instead of
assuming the number is current.

The first two digits are the county (fylke).

## næringskode (NACE)

Industry classification, format `nn.nnn`. Examples:

| Code | Industry |
|---|---|
| 47.111 | Grocery retail |
| 62.010 | Computer programming |
| 41.200 | Building construction |
| 68.209 | Real estate letting |
| 70.220 | Business consultancy |

An entity can have up to three (`naeringskode1`, `2`, `3`). Screening on
`naeringskode1` alone will miss companies where the activity is secondary.

Codes are hierarchical: `47` is retail, `47.1` retail in non-specialised stores,
`47.111` grocery. Search operations match the code you give as a prefix, so
`47.1` is a broader screen than `47.111`.

## postnummer

Four digits. Not the same as kommunenummer and not derivable from it — a
municipality spans many postcodes and some postcodes cross municipal borders.
Oslo postcodes start at 0001; the numbering runs roughly south-east to north.

## What to do with an unknown identifier

Pass it to `norsk_resolve`. It detects org numbers (with checksum validation)
and address-shaped text, and falls back to a company name search. If it comes
back empty, ask the user what kind of identifier it is rather than guessing.
