There is a persistent narrative in Silicon Valley that software engineering is a young person's game. The hoodies, the ping-pong tables, the energy drinks at 2 AM -- the cultural signaling is not subtle. But what does the data actually say about tech careers after 40? More specifically, what happens to your paycheck?

The answer is more nuanced than "it goes down." For some, salaries plateau. For others, they accelerate into territory most 25-year-olds cannot imagine. The difference comes down to choices made years earlier -- choices that many developers do not realize they are making until it is too late.

We pulled data from AARP workforce studies, Stack Overflow surveys, Bureau of Labor Statistics reports, and compensation databases to build a clear picture. Here is what the numbers reveal.

The Data: When Does a Tech Salary Peak?

For the average software developer in the United States, base salary follows a predictable arc. It rises sharply from entry level through the late 20s, continues climbing through the 30s at a slower pace, and reaches its peak somewhere between 42 and 48, depending on the role and company tier.

After that peak, the trajectory splits dramatically:

  • Developers who stay individual contributors at mid-tier companies see salaries flatten and then decline by 5-15% between ages 50 and 60.
  • Developers who move into management see continued growth, but the gains become title-dependent rather than skill-dependent.
  • Staff and principal engineers at top-tier companies maintain or increase compensation well into their 50s and beyond.

The median base salary for a software engineer in the US sits around $130K. For developers over 45, that number drops to roughly $118K -- but this average is skewed by the massive number of older developers working at non-tech companies where pay scales are lower across the board.

At companies like Google, Meta, Amazon, and Apple, the picture looks different. Staff engineers (L6+) earn a median total compensation of $350K or more, and age is not the determining factor -- level is. A 52-year-old staff engineer at Google earns the same (or more) as a 35-year-old at the same level.

The salary "decline" after 40 is less about age discrimination in compensation and more about where older developers end up working.

The Ageism Problem: What the Numbers Show

Let us be direct: ageism in tech is real, measurable, and well-documented.

According to AARP's research, 80% of workers aged 40-65 have either witnessed or personally experienced age discrimination in the workplace. That is not a tech-specific number -- it spans all industries. But tech has a uniquely aggressive timeline.

In most industries, age discrimination concerns start around age 50. In technology, the research shows a different pattern:

  • Age 29: When ageism-related anxiety begins among tech workers
  • Age 38: When tech workers are considered "over the hill" -- a full 12 years earlier than workers in other industries
  • Age 45+: Only less than 11% of professional developers fall into this age bracket, per Stack Overflow's developer survey

That last statistic deserves attention. If fewer than 11% of working developers are 45 or older, something is causing a massive exodus between 35 and 45. It is not death or retirement. It is structural.

One telling data point: 51% of workers who have experienced age discrimination say they would leave their job because of it. In tech, many of them do -- but they do not leave the workforce. They leave coding.

Why Only 19% of CS Grads Are Still Coding at 40

This is perhaps the most striking number in the entire dataset. Research tracking computer science graduates over their careers found that only 19% are still working as programmers by their early 40s. At the 6-year mark after graduation, that number was 57%.

Where did the other 38 percentage points go?

The breakdown looks roughly like this:

  • ~25% moved into management (engineering managers, directors, VPs)
  • ~18% moved into adjacent roles (product management, technical sales, consulting)
  • ~12% left tech entirely (finance, real estate, education, entrepreneurship)
  • ~7% went independent (freelance, contracting, startups)
  • ~19% are still coding

This is not necessarily a tragedy. Many of those transitions are voluntary and financially rewarding. Engineering directors at large companies routinely earn $300K-$500K in total compensation. Technical sales engineers at enterprise software companies can clear $250K+ with commissions.

But the data suggests a significant portion of that attrition is involuntary or semi-voluntary -- driven by:

  1. Hiring bias against older candidates (callback rates drop measurably after age 40 on identical resumes)
  2. Cultural exclusion (being the oldest person on a team of 26-year-olds takes a psychological toll)
  3. Perceived obsolescence (the assumption that older developers cannot learn new frameworks, despite evidence to the contrary)
  4. Compensation compression (newly hired engineers getting offers comparable to tenured engineers, eliminating the experience premium)

That last point is particularly corrosive. Research shows that newly hired older workers often receive the same average salary as tenured workers at the same level. When a 42-year-old with 18 years of experience gets the same offer as a 28-year-old with 4 years, the implicit message is clear: your extra decade of experience has no market value here.

IC vs Management: Two Very Different Salary Paths After 40

After 40, the career path you have chosen -- or the one chosen for you -- determines your salary trajectory more than almost any other factor.

The Management Track

Engineering managers who reach the director level by 40 are in a strong position. The salary trajectory looks like this:

| Role | Median TC (Big Tech) | Median TC (Mid-Market) | |------|---------------------|----------------------| | Engineering Manager | $280K-$350K | $180K-$240K | | Senior EM / Director | $350K-$500K | $230K-$320K | | VP of Engineering | $500K-$800K | $300K-$450K | | CTO / SVP | $700K-$1.5M+ | $350K-$600K |

These numbers continue climbing with age because executive compensation is tied to scope, not individual output. A 55-year-old VP running 200 engineers is worth more to an organization than a 40-year-old VP running 50, all else being equal.

The IC (Individual Contributor) Track

The IC track tells a more complicated story. At companies with well-defined IC ladders (Google, Meta, Amazon, Netflix, Stripe), senior ICs can earn extraordinary compensation:

| Level | Typical Title | Median TC | |-------|--------------|-----------| | L5 | Senior Engineer | $250K-$320K | | L6 | Staff Engineer | $350K-$450K | | L7 | Senior Staff | $500K-$650K | | L8 | Principal Engineer | $700K-$1M+ |

At these levels, age is genuinely irrelevant. A principal engineer at Google earns $700K+ whether they are 38 or 58. The problem is that fewer than 5% of software engineers ever reach staff level, and the path requires deliberate career management that many developers do not begin until it is too late.

At companies without strong IC ladders -- which is the majority of employers -- the senior IC track tops out at $150K-$200K, and that ceiling can feel very low for someone with 20+ years of experience and a mortgage.

Companies Where Age Does Not Limit Your Salary

Not every company treats experience as a liability. Some actively value it. Based on compensation data and workforce demographics, these categories stand out:

Defense and government contractors (Lockheed Martin, Raytheon, Northrop Grumman, Booz Allen): Average developer age skews older, 40+ developers are common at senior levels, and compensation is competitive if not spectacular ($130K-$200K+ for senior roles). Security clearances become more valuable over time, not less.

Financial institutions (Goldman Sachs, JP Morgan, Bloomberg, Two Sigma): Pay is high ($200K-$400K+ for senior developers), the work values stability and deep domain knowledge, and the culture is less youth-obsessed than consumer tech.

Enterprise software (Salesforce, SAP, Oracle, ServiceNow): These companies have mature products that require mature engineers who understand complex systems. The median developer age is higher, and compensation scales with experience.

Big Tech IC tracks (Google, Meta, Apple, Amazon, Microsoft): Despite cultural perceptions, these companies pay by level, not by age. The challenge is getting hired and promoted, not being compensated once you are there.

One counterintuitive finding: workers over 40 who are not in management positions receive increasingly higher top-performer ratings compared to their younger peers. The data suggests that experienced ICs who survive the attrition are disproportionately excellent at their jobs.

Salary Optimization Strategies for Developers Over 40

Based on the data patterns, here are the strategies that correlate with higher earnings for developers past 40:

1. Specialize in high-value, low-supply domains

The areas where experience commands the highest premium are the ones where mistakes are expensive and tribal knowledge matters:

  • Infrastructure and reliability engineering: Companies will pay $300K+ for someone who has debugged production incidents for 15 years
  • Security engineering: Senior security engineers are chronically undersupplied. Median TC for staff-level security roles: $320K+
  • Database and data infrastructure: The move to distributed systems has made experienced database engineers more valuable, not less
  • Compiler and systems programming: Rust, kernel development, embedded systems -- these fields have graying workforces and rising demand

2. Build a compensation portfolio, not just a salary

After 40, total compensation matters more than base salary. The developers earning $400K+ at 50 typically have:

  • Base salary: 30-40% of total
  • RSUs/equity: 40-50% of total
  • Bonuses: 10-15% of total
  • Advisory/consulting/board income: supplemental

3. Stay at companies with transparent leveling

The biggest risk to your salary after 40 is being at a company where compensation is arbitrary. Companies with published levels and bands (Google, Meta, Stripe, Netflix) make it harder to underpay experienced engineers.

4. Negotiate from data, not from tenure

When negotiating, do not lead with "I have 20 years of experience." Lead with "The market rate for this level at comparable companies is X, and here is the data." Use our salary calculator to benchmark your current position against market rates.

5. Consider geographic arbitrage

Remote work has created an opportunity for older developers who may own homes in lower-cost areas. A staff engineer earning Bay Area compensation while living in Austin or Raleigh has an effective income 30-50% higher than their peers paying San Francisco housing costs. Use our compare cities tool to model the difference.

The Senior Advantage: Why Experience Still Commands a Premium

Despite the ageism data, there is a strong counterargument backed by numbers: experienced developers who position themselves correctly are among the highest-paid professionals in any field.

Consider these data points:

  • Staff engineers at FAANG companies earn $350K+ median TC regardless of age
  • 40+ non-managers receive increasingly top performer ratings -- they are not coasting, they are outperforming
  • Architectural and system design skills -- which take a decade or more to develop -- are the primary differentiator for L6+ roles
  • Mentorship and technical leadership create organizational leverage that compounds over time

The developers who earn the most after 40 share common traits:

  1. They chose companies with real IC tracks before they needed them
  2. They specialized early enough to become genuinely difficult to replace
  3. They maintained technical currency without chasing every new framework
  4. They built internal and external reputations that made their value visible

The 80% ageism statistic is real. But so is the $350K+ staff engineer salary. The question is which side of that divide you end up on, and the answer is largely determined by decisions made in your 30s.

The Bottom Line

Tech careers after 40 are not a uniform story of decline. They are a story of divergence. The data shows two clear paths:

Path A: Stay at mid-tier companies as a senior developer, experience salary compression, face ageism in hiring, and watch your earnings flatten or decline. This is the path of least resistance, and it is where the majority of the 81% who stop coding end up before they leave.

Path B: Deliberately build toward staff-level roles, specialize in high-value domains, work at companies with transparent compensation structures, and leverage 15+ years of pattern recognition into roles that pay $300K-$700K+. This path requires intentional career management but produces outcomes that rival or exceed the management track.

The uncomfortable truth is that the window for choosing Path B narrows significantly after 40. The developers who are thriving at 50 did not start planning at 49. They started at 35.

If you are in your 30s reading this, the time to audit your trajectory is now. Check where your salary stands against market rates with our salary calculator, and compare your cost-of-living adjusted income across cities using our compare cities tool.

If you are already past 40, the data says you are not doomed -- but you may need to make bigger moves than you expected. The companies, roles, and specializations that value experience are out there. The salary data proves it. You just cannot afford to wait for them to find you.

For a complete framework on negotiation tactics, career pivots, and long-term compensation strategy at any stage, explore our Salary Negotiation & Career Growth Guide.