Compare employer wage and benefit costs in Python

Compare national manufacturing and professional/business-services wages, benefits, health-insurance and retirement costs using BLS ECEC dollars per hour worked and published shares.

Compare the components of employer compensation

A wage figure does not describe the whole cost of employing someone. This example uses BLS Employer Costs for Employee Compensation (ECEC) data to compare wages, total benefits, health insurance and retirement costs in manufacturing and professional/business services for the fourth quarter of 2025.

The optional input.csv contains eight industry/component selections. The same choices appear in the selections list in the Python code below. These are lookup choices, not an invented workforce or simulated costs.

Download quarterly_costs.csv into your working folder. It is a genuine subset of the paid table: 128 observations covering all quarters of 2024–2025 for the selected dollar-cost and percentage-share series, with all 34 fields unchanged. The full $29 edition includes 551,122 quarterly observations across 6,906 national series, plus relative standard errors, definitions, footnotes and coverage. Inspect the full coverage and fields.

Code example

This standard-library code runs in a notebook cell, IPython or a script. It selects private-industry workers (owner_code = 2), all occupations in each chosen industry, and 2025-Q4. Each component has a dollar estimate (D) and a published share (P). Change quarter or the selections to investigate another available group or period.

Paths are relative to your working folder; use from pathlib import Path; print(Path.cwd()) to check it, or supply full paths.

Python 3.10+ · Jupyter, IPython or a script
"""Compare actual employer cost components for two national industry groups."""
import csv
from decimal import Decimal

# These are analysis selections. All estimates come from the supplied BLS sample.
selections = [
    {'industry_code': industry, 'estimate_code': component}
    for industry in ['300000', '540A00']
    for component in ['02', '03', '15', '18']
]
quarter = '2025-Q4'
lookup = {}
with open('quarterly_costs.csv', newline='', encoding='utf-8') as source:
    for row in csv.DictReader(source):
        if (row['quarter'] == quarter and row['owner_code'] == '2'
                and row['occupation_code'] == '000000' and row['subcell_code'] == '00'):
            key = (row['industry_code'], row['estimate_code'], row['datatype_code'])
            if key in lookup:
                raise ValueError(f'More than one estimate for {key}')
            lookup[key] = row
results = []
for selection in selections:
    key = (selection['industry_code'], selection['estimate_code'])
    dollars = lookup.get((*key, 'D'))
    share = lookup.get((*key, 'P'))
    if dollars is None or share is None:
        raise ValueError(f'No published dollar/share pair for {key}')
    if dollars['availability'] != 'reported' or share['availability'] != 'reported':
        raise ValueError(f'Inspect availability and footnotes before using {key}')
    result = {'industry': dollars['industry_name'], 'component': dollars['estimate_name'],
              'cost_per_hour': dollars['value'], 'share_percent': share['value']}
    results.append(result)
    print(f"{result['industry']} | {result['component']}: "
          f"${Decimal(result['cost_per_hour']):.2f}/hour; "
          f"{Decimal(result['share_percent']):.1f}% of compensation")

Analysis of the output

Manufacturing | Wages and salaries: $31.88/hour; 66.9% of compensation
Manufacturing | Total benefits: $15.76/hour; 33.1% of compensation
Manufacturing | Health insurance: $4.21/hour; 8.8% of compensation
Manufacturing | Retirement and savings: $1.57/hour; 3.3% of compensation
Professional and business services | Wages and salaries: $41.29/hour; 69.4% of compensation
Professional and business services | Total benefits: $18.18/hour; 30.6% of compensation
Professional and business services | Health insurance: $3.90/hour; 6.6% of compensation
Professional and business services | Retirement and savings: $1.93/hour; 3.3% of compensation

For manufacturing, wages cost $31.88 per employee hour worked and total benefits cost $15.76; the published benefit share is 33.1% of total compensation. For professional and business services, wages cost $41.29 and benefits cost $18.18, with a benefit share of 30.6%. This illustrates why a higher dollar amount can coexist with a lower share of compensation.

Health insurance and retirement are included within total benefits. Do not add them to total benefits again. The code reads the original BLS percentage shares instead of calculating ratios from rounded dollar amounts.

These are national averages across all workers in each group, including workers without access to or participation in a benefit. They are not costs per insured employee, a quote for a particular employer, or annual salaries. A difference between displayed averages does not itself establish statistical significance; the full download includes relative standard errors and source notes.

Choose the compensation measure for the task

Use ECEC to examine the level and composition of employer costs. Use the Employment Cost Index to follow cost growth with employment-mix effects controlled. Use occupational employment and wage estimates for occupation-specific wage levels and staffing. Their populations, classifications and measures differ; these links are not an automatic crosswalk.

Compare related business and labor datasets →

Using the full dataset

Extract the purchased ZIP and replace the sample with its complete quarterly_costs.csv. The example runs unchanged. The full table contains national civilian, private-industry and state/local-government costs and shares for 2004–2025 where published, across 28 cost components and available industry, occupation and worker-group categories.

The unique key is series_id + year + period. series.csv provides original source titles, component and group codes, start/end dates and delivered coverage. groups.csv supplies their labels. Keep identifiers as text, review overlapping groups, and do not treat ECEC codes as a direct NAICS/SOC crosswalk. All delivered series are unadjusted.

The source dash has more than one meaning. In the main table, availability distinguishes an unavailable estimate from a cost at or below $0.01 or a share below 0.05%. The latter rows retain upper_bound and upper_bound_inclusive; their numeric value stays blank. Published numeric zero is preserved. The example stops if a requested value is not reported rather than silently treating a bound or missing value as zero.

Join relative_standard_errors.csv on the same series/year/period key to review precision. Its RSE is a percent of the estimate, not an absolute standard error; reasons for unavailable precision remain explicit. footnotes.csv retains original notes and flags legacy definition links that now redirect. coverage.csv separates reported, threshold, unavailable and absent quarters. Individual histories vary, including 374 series ending before 2025 Q4; no successors are spliced. source_accounting.csv accounts for included and excluded source rows.

Sources and versions

Source: BLS ECEC bulk files, captured November 6, 2026 UTC, with bulk data last modified September 9. Observation coverage is 2004–2025 where available; this is the retained historical snapshot, not original quarterly publication vintages or a live feed.

Read the technical notes, relative-standard-error guidance and classification history. The start date aligns with the NAICS/SOC-based history. Regional/metro series, wage-percentile and constant-dollar statistics, and partial 2026 history are outside this edition.

The one-time purchase includes processing improvements and documented publisher error corrections to this edition. New periods or genuinely new source editions may be sold separately; routine revisions are not automatically errata. BLS provides the source data free. ACD sells preparation, validation, documentation and delivery. Read the preparation record.

Example checked November 6, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.