We use matched employer-employee data and firm balance sheet data to investigate the importance of firm productivity and firm labor market power in explaining firm heterogeneity in wage formation. We use a linear regression model with one interacted high dimensional fixed effect to estimate 5-digit sector-specific elasticity of output with respect to input factors directly from the production function. This allows to derive firm specific price-cost mark-up and elasticity of labor supply. The results show that firms possess a considerable degree of product and labor market power. Furthermore, we find evidence that firm's monopsony power affects negatively the earnings of its workers and firm's total factor productivity is considerably associated with higher earnings, ceteris paribus. We also find that firms use monopsony power for wage differentiation between male and female workers.