Did a pay raise beat inflation?
compare_raise_to_inflationCompares a pay change with CPI inflation over the same period using official BLS data through the latest published month (checked live). Returns the nominal raise, inflation, the real (inflation-adjusted) raise, the pay needed to keep pace, and the gain or shortfall. Works for salaries, hourly wages, rents or any recurring amount.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | When to measure, default "latest": "YYYY" for the annual average, "YYYY-MM" for one month, or "latest". | |
| from | Yes | When the old pay started, e.g. "2024-01": "YYYY" for the annual average, "YYYY-MM" for one month, or "latest". | |
| series | No | cpi_u (default, the headline CPI), cpi_w (wage earners, used for Social Security COLAs) or core (CPI-U less food and energy). | |
| new_pay | Yes | Pay after the change, same unit. | |
| old_pay | Yes | Pay before the change (annual salary or hourly rate). |