The Bureau of Labor Statistics' fourth-quarter earnings survey is out, and the news is generally good. The median American was taking home $41,392 at the end of last year, up 1.7% from last year and slightly outpacing inflation.

But that headline number alone doesn't really tell the whole story. As you might expect, the data gets much more interesting when you start investigating certain variables, like one's age and sex. 

Close-up of income section of tax form

Image source: Getty Images.

To get a better idea of how you compare to your peers, check out the graph below, which breaks down earnings by specific age groups for both men and women.

Median American Salary by Age and Sex in 2014 | Create infographics

There are two huge and important takeaways from this data: younger workers earn less, and women earn less. Let's go over what each group can do to neutralize this comparative disadvantage and still achieve financial independence.

Younger workers still have one big advantage
It's makes sense that the more experience you have in your field, the higher your salary will be. No one should be too surprised to see the typical 24-year-old earning about 45% less than her 55-year-old colleagues.

But there's a terrible irony to the situation in general: Money saved and invested when you're 24 will be worth a lot more upon your retirement than money put away when you're 55. That's because it will have three more decades to compound.

To get an idea for what I'm talking about, let's consider two scenarios. In our first, we have Sarah -- a hard-working, 24-year-old who somehow manages to put away $200 per month, every month, until the age of 30. After that, she is no longer able to save, as the additional costs of raising a family and now only working part-time take a financial toll.

Our second subject is Tim, who didn't pay much attention to saving for retirement until he hit age 55. He has had above-average earnings his whole career, but usually spent all of that money in short order. Now that he's 55, he gets serious and starts putting away a whopping $1,500 per month -- far more than Sarah did, even after inflation.

Assuming both of them earn the S&P 500's historical return of about 9%, who will have more money when they hit 70? Surprisingly, Sarah will!

The Importance of Time with Your Investments | Create infographics

This leaves us with one hard and fast conclusion: Be extra mindful of your spending and saving during your early working years. Sarah only saved for seven years, but it ended up making a huge difference in the long run. If nothing else, make sure you do everything you can to get your maximum employer match in your 401(k) or 403(b) plan -- if it is offered to you.

Females earn less, but save and invest more... most of the time
By the end of 2014, the median female worker was earning $37,596, while her male counterpart was pulling in $45,500. But there's a crazy irony here as well: Most working women have more in savings than men.

That's because women participate in workplace savings programs at higher rates than men and save more of their salaries than men. For instance, 79% of women earning between $50,000 and $75,000 per year participate in such programs -- versus 60% for men -- and sock away an average of 7.2% of their salary -- versus 6.7% for men. The same general pattern holds true across all income levels, according to Vanguard.

In fact, for all income levels except those over $100,000 per year, the median female has more saved than the median male. That's an impressive feat to say the least. And the most obvious explanation for the difference among the highest earners is that men rarely take time off of work to help raise families -- which means that they get the promotions that accompany such high salaries earlier in their careers. That gives their investments more time to compound.

Women earning over $100,000 can help offset their savings shortfall by taking a more aggressive stance in how they invest their dollars. Although this usually means more volatility in the short term, it can create greater returns over the long run.

What you save now matters
In the end, what you are able to save -- and invest -- right now will make a huge difference in how prepared you are for retirement.

If you are younger, save and invest whatever you have. You have a crucial advantage on your side: time.

And if you are a woman, keep up the impressive saving and investing habits. If you're a high earner who wants to keep pace with your male counterparts, consider taking a more aggressive investing approach.

And if you're behind on your retirement savings -- man or woman, young or old -- we might have found just thing to help.