Sub topic 9
Numbering and Coding WBS Elements
This chapter assumes you can already read a WBS outline, know what a work package is, and have applied the 100% rule to a decomposition. Here you will learn how to give every element a stable, meaningful code. You will also learn what those codes can and cannot do for you.
Why codes matter
A WBS element name such as "Page templates" is fine for people reading one document. It breaks down when the same name appears in a cost report, a schedule, a risk register and a contract. A WBS code is a unique identifier that every one of those documents can use to point at exactly one element.
Good codes give you three things:
- Uniqueness. Two elements never share a code, even if they share a name.
- Position. The code tells you where the element sits in the hierarchy, and which parent it belongs to.
- Traceability. Cost, effort, risks and changes can be tied to the same code across tools.
The standard scheme: dotted hierarchical codes
The most common scheme is a dotted decimal code. The root is 1. Each child takes its parent's code, adds a dot, and adds its own sequence number.
1 Website Relaunch
1.1 Design
1.1.1 Page templates
1.1.2 Style guide
1.2 Content
1.2.1 Migrated pages
1.2.2 New landing pages
1.3 Platform
1.3.1 Hosting environment
1.3.2 Content management configuration
1.4 Project management
1.4.1 Project plan and status reportsThe rules are simple:
- The root element gets one segment, here
1. - A child's code is its parent's code, then a dot, then a number that is unique among its siblings.
- The number of segments equals the level.
1.1.1is on level 3. - A parent's code is always a prefix of every descendant's code.
Rule 4 is what makes the code useful. From 1.2.1 alone you know the element sits under 1.2, which sits under 1. You do not need the chart.
The diagram below shows the same prefix relationship as a tree.
Design decisions for a numbering scheme
Numbers are identifiers, not an ordering of work
The sequence number among siblings does not mean "do this first". 1.1.2 Style guide may need to finish before 1.1.1 Page templates starts. Sequence and dependency belong in the schedule. If you read the code as an order of execution, you will build false dependencies into the plan.
Do not renumber when things move
Codes are referenced from other documents. If you delete 1.2.1 and shift 1.2.2 down to 1.2.1, every report that cited the old 1.2.1 now points at different work. Treat a retired code as retired. Do not reuse it. Gaps in the sequence are acceptable and are better than ambiguity.
Many teams also leave gaps on purpose when they first number, for example 10, 20, 30. This leaves room to insert a new sibling later without renumbering.
Alphanumeric and fixed-width codes
Some organizations use letters or fixed-width segments. Typical reasons are a mandated format from a customer, or integration with a finance system that expects a fixed-length account string.
| Scheme | Example | Strength | Weakness |
|---|---|---|---|
| Dotted decimal | `1.2.1` | Easy to read, shows depth at a glance | Sorts incorrectly as text: `1.10` sorts before `1.2` |
| Zero-padded | `01.02.01` | Sorts correctly as text | Fixed width limits siblings to 99 |
| Alphanumeric | `WEB-DES-TPL` | Readable without a legend | Longer, and abbreviations can clash |
| Flat ID | `W0017` | Never needs to change | Carries no hierarchy, so you need a separate parent column |
Pick one scheme per project and write it down. Mixing schemes inside one WBS is a common source of broken lookups.
Keep the depth honest
If you find yourself with codes like 1.3.2.4.1.2, ask whether the decomposition went too deep. Long codes often signal that you decomposed past the point where elements can be usefully estimated and tracked. Numbering will not fix that, but it will expose it.
Codes and the project management element
Management work needs a code too. In the example, 1.4 Project management holds 1.4.1 Project plan and status reports. Giving management effort its own element means its cost is tracked rather than hidden inside the other elements. This is also part of the 100% rule: if the work is in the scope, it needs a code.
Using codes in tools
Because a parent code is a prefix of its children, you can group and roll up with simple string logic. This script checks that every child code sits under its parent and that no two codes are the same. It then prints each element's level.
wbs_codes = [
"1", "1.1", "1.1.1", "1.1.2",
"1.2", "1.2.1", "1.2.2",
"1.3", "1.3.1", "1.3.2",
"1.4", "1.4.1",
]
def parent_of(code):
if "." not in code:
return None
return code.rsplit(".", 1)[0]
def check_codes(codes):
seen = set()
for code in codes:
if code in seen:
raise ValueError(f"duplicate code {code}")
seen.add(code)
for code in codes:
parent = parent_of(code)
if parent is not None and parent not in seen:
raise ValueError(f"{code} has no parent {parent}")
def level(code):
return code.count(".") + 1
check_codes(wbs_codes)
for code in wbs_codes:
print(f"{' ' * (level(code) - 1)}{code} (level {level(code)})")The check catches two typical mistakes: a duplicated code, and an orphan whose parent was deleted or mistyped. If you sort codes in a script, convert each segment to an integer first. Otherwise 1.10 lands before 1.2.
def sort_key(code):
return [int(part) for part in code.split(".")]
codes = ["1.10", "1.2", "1.1", "1.2.1"]
print(sorted(codes)) # ['1.1', '1.10', '1.2', '1.2.1']
print(sorted(codes, key=sort_key)) # ['1.1', '1.2', '1.2.1', '1.10']Codes in the WBS dictionary
The code is the key of each WBS dictionary entry. In the entry for 1.1.1, the code field identifies the element, and the excluded field points to another element by its code, here 1.2. That cross-reference is why codes must stay stable: a renumbered element silently breaks the exclusion note that keeps two elements from overlapping.
code: "1.1.1"
name: Page templates
estimate_days: 8
assumptions:
- Style guide 1.1.2 is approved before build starts
excluded: Content writing (see 1.2)Common mistakes
- Reusing a retired code for new work, so old reports describe the wrong element.
- Encoding the schedule in the code, for example using
1.1for "phase one" and then moving work between phases. - Encoding the owner or the cost center in the code. People and budgets change. The WBS should not need renumbering when they do.
- Different schemes in different tools. A finance system using
W0017and a plan using1.1.1need a maintained mapping table. - Treating the code as the definition. A code identifies an element. The name and dictionary entry define it.
Exercises
Exercise
A team deletes element 1.2.1 and renumbers 1.2.2 as 1.2.1 so the list has no gap. Last month's cost report lists 1.2.1 as 40 hours. Name the problem this causes and what the team should have done.
Show answer
The old cost report's 1.2.1 now points at different work, so history and the new element become indistinguishable. The team should have retired 1.2.1 without reusing it, left the gap, and kept 1.2.2 as it was. Any change to a baselined code should go through change control.
Exercise
What is wrong with this list of codes, and which check from the chapter would find it? 1, 1.1, 1.1.1, 1.2.1, 1.2.1
Show answer
The code 1.2.1 appears twice, so it is not unique, and its parent 1.2 is missing from the list. The check_codes function catches both: it raises on the duplicate and would raise "has no parent 1.2" for the orphan.
Exercise
You sort the text codes 1.1, 1.2, 1.10 and get 1.1, 1.10, 1.2. Give two ways to fix the ordering.
Show answer
Sort by integer segments (split on the dot and convert each part to int), or use zero-padded codes such as 01.01, 01.02, 01.10 so text order matches numeric order.