At Brian Bader's orientation for a tech-support job with Apple Inc. three years ago, he says, human-resources managers ran down the list of guidelines workers were expected to follow. Don't use explicit language on calls with customers. Treat other employees with respect. And, he says, they told the assembled recruits, don't discuss your pay with co-workers.

That last requirement backfired. "It just made me more curious," said Mr. Bader, 25 years old, who had been offered $12 per hour. Throughout the day's breaks, he surveyed his new colleagues about their wages, and learned that everyone was earning somewhere between $10 and $12 per hour. Apple declined to comment on internal policies.

That information became the basis of his decision to leave his job just three months later, after he realized—thanks to the performance data managers shared with their teams every week, detailing such metrics as how many calls each employee had answered and problems solved—that he was twice as productive as the lowest performer on the team, yet earned only 20% more.

"It irked me. If I'm doing double the work, why am I not seeing double the pay?" said Mr. Bader, who is about to graduate from California State University, Sacramento.

Vote and Comment

Comparing salaries among colleagues has long been a taboo of workplace chatter, but that is changing as Millennials—individuals born in the 1980s and 1990s—join the labor force. Accustomed to documenting their lives in real time on social-media forums like Facebook and Twitter, they are bringing their embrace of self-disclosure into the office with them. And they're using this information to negotiate raises at their current employer or higher salaries when moving to a new job.

Not surprisingly, many firms want to keep salary information private. They hope to retain the upper hand on salary negotiation and hope to keep flawed or even discriminatory compensation systems under wraps.

Comparing salaries among colleagues has long been a taboo of workplace chatter, but that is changing as Millennials—individuals born in the 1980s and 1990s—join the labor force. James Yang

But for workers, information is power, and young people recognize this. "People are much more willing to talk about pay than they were even 10 years ago," says Kevin Hallock, director of the Institute for Compensation Studies at Cornell University and author of the 2012 book "Pay: Why People Earn What They Earn and What You Can Do Now to Make More."

Still, revealing pay can be risky business.

Pay differentials, when they become public, can engender resentment, envy and dissatisfaction among workers, especially those who find themselves on the low end of the scale. One 2012 study by researchers at University of California, Berkeley and Princeton University examined more than 6,400 University of California employees once they became aware of a database listing staffers' salaries. Employees who were paid below the median were unhappy once they learned their colleagues' pay and were more likely to look for other jobs.

While some of this information—such as salaries of certain state employees—has long been a matter of public record, the Internet has made it far more accessible, too, says Mr. Hallock. Sites where people post salaries and other feedback about employers, such as Glassdoor.com, also contribute to the sense that pay is no longer a private issue.

When Dustin Zick, 25, was ready to leave his job in 2012 as a social-media specialist at BuySeasons Inc., a Milwaukee-based online retailer, he compared notes with "five or six" trusted co-workers about their pay, and found most of them happy to divulge.

Several of his colleagues, also looking for new opportunities, strategized together about what salaries they were aiming for and how to negotiate to get there. The conversations helped Mr. Zick achieve his target salary at his new position as a social-media manager at a hospitality company, he says.

"There's a culture of transparency in my generation," he says. And "the younger you are, the more likely an employer will try to get you for cheap. So to know what your peers are making benefits all parties involved, except maybe the employer."

Companies may not like transparency, but they cannot outright bar rank-and-file employees from disclosing their pay internally or externally, under the federal National Labor Relations Act, says Fort Lauderdale employment lawyer Charles Caulkins of law firm Fisher & Phillips. That means that an employee handbook or social-media policy barring workers from disclosing their pay is generally a violation, he says. (The rules are different for managers and supervisors, who can legally be prevented from disclosing pay.)

Ultimately, says Mr. Hallock, compensation is an inexact science, determined by labor-market conditions, company budgets and individual employees' performance and turnover risk. Companies use salaries and raises to retain their high performers, but measuring performance itself is difficult, especially in fields that defy simple metrics like widgets built or customer-service calls answered.

So one way for employers to head off internal politics: Be even more transparent.

New York data-analytics company SumAll makes pay scales and individual salaries open to everyone in the company. The company says that employees work more efficiently when no one is trying to guess whether their colleagues are making more than they are.

And in his current tech startup, Jay Adelson, a co-founder of several tech companies, including the social-media site Digg, is experimenting with peer-based bonuses and clear salary bands to help employees feel they are getting paid equitably, although individual salaries aren't published.

Workers and employers who support transparency argue that it helps ensure that people are paid fairly, and reduces discrimination based on gender or other characteristics.

Of course, not every employee is, or would be, willing to spill.

Lucy Bayly, 43, a copywriter for an advertising agency in Oneonta, N.Y., compares discussions about income with conversations about sex: "You're dying to know, but it's too rude to ask."

Such conversations run the risk of inspiring a corrosive kind of jealousy, she says. "You think you're satisfied and then all of a sudden, you find out someone is paid a little more, and it ruins your day because you start wondering, 'Have I settled?' "

How to Discuss Pay at Work

Tips for bringing up the subject in a constructive way:

When talking about salary with coworkers:

1. Reserve these conversations for people you trust

2. Know your motivation—don't bring up the topic if you just want to brag. That never goes over well.

3. If you plan to use the information to negotiate with your boss, ask your colleagues' permission first.

4. Be willing to be disappointed or embarrassed. You might find out that your salary falls short of your peer's.

When talking about salary with a manager:

1. It's acceptable to ask a manager about the company's pay philosophy and pay practices. Leaders should be able to explain why they pay the way they do.

2. If you're asking for a raise, do it after acing a project.

3. Understand the company context. Don't ask for a raise if the company just announced a terrible quarter.

4. Don't betray your co-workers' confidence.

Source: Rusty Rueff, career expert at Glassdoor

Write to Lauren Weber at lauren.weber@wsj.com and Rachel Emma Silverman at rachel.silverman@wsj.com