People that have climbed to the top of the corporate ladder are going to have to start giving everyone an idea of what the view is like up there.

U.S. companies will have to start divulging how much more their CEOs make in comparison to regular workers thanks to a new rule adopted by the Securities and Exchange Commission on Wednesday.

Going forward, every public company will be forced to report the ratio of the total yearly compensation of its CEO in comparison to the median salary of its workers.

The median point is the number at which half a company's employees make less and the other half make more.

The goal is, in part, salary-shaming CEOs who are overpaid. The hope is that by having to disclose this information, companies will be swayed to cap executive pay, lift wages or both. The rule, however, will not go into effect until January 1, 2017, meaning companies will probably not have to divulge the ratios until 2018.

Companies and their lobbyists had worked hard to amend the rule, arguing that they should be allowed to exclude many foreign workers, who often make low wages. In the end, they mostly failed. Companies will only be able to exclude 5% of their foreign workforce from the calculations.

CEO salaries became one of the central rallying cries during the financial crisis, particularly as executives were compensated with millions of dollars despite overseeing crumbling businesses. Highly paid chief executives were often used to illustrate the wealth gap that had only been widened by the country's economic woes.

Some major U.S. companies are already known for having an huge ratio. PayScale, a company that specializes in salary and compensation information, pegs Walmart as having by far the biggest difference with CEO Michael Duke making 1,034 times the median work for the retail outlet. Others near the top of the list include Target (591:1), Disney (557:1), McDonald's (535:1) and Rupert Murdoch's News Corp (409:1).

The new rule has its origins in financial regulations that arose out of the crisis, with the CEO pay rule having been part of the Dodd-Frank rules back in July 2010. Wednesday's vote is the culmination of years of sluggish progress from the SEC. The regulator first wrote the rules around how companies will have to disclose its CEO-to-worker pay ratio back in September 2013.

More recently, U.S. workers have seen their paychecks stay about the same despite a recovery in the broader economy. This wage stagnation has been cause for concern among economists, particularly as CEO pay has continued to rise. One recent study from labor organization AFL-CIO found that CEOs of major U.S. companies earned about 373 times the average U.S. worker.

Public companies — those that have stock that can be freely traded on exchanges — have already had to divulge the salaries of CEOs and other executives in annual reports, but the new rule marks the first time such pay will be presented in comparison to workers. GoPro CEO Nicholas Woodman is believed to be the highest paid chief executive, having made $284.5 million in 2014 primarily from stock grants.

While not entirely supported by the SEC — Chairwoman Mary Jo White said that the rule was controversial but that the regulator is "required to carry it out — the proposal received more than 280,000 comments in support.