Territorial unit code format differs in each territorial unit layout.

In view by NTS classification it has structure:

0000000000- total 10 characters
1.2.3.4.5.
where number denote:
1. Region symbol (0, 1, ..., 6) - one character
2. Voivodeship symbol (00, 02, ..., 32)- two characters
3. Subregion symbol (00, 01, ..., 66/72)- two characters
4. Powiat symbol (00, 01, ..., 59 - powiats; 60, ..., 99 - cities with powiat status)- two characters
5. Symbol of gmina/part of the gmina (000......, where the last character is unit type symbol) - three characters

and in view by TERYT register:

0000000- total 7 characters
1.2.3.
where number denote:
1. Voivodeship symbol (00, 02, ..., 32)- two characters
2. Powiat symbol (00, 01, ..., 59 - powiats; 60, ..., 99 - cities with powiat status)- two characters
3. Symbol of gmina/part of the gmina (000......, where the last character is unit type symbol) - three characters