Earnings management (EM) is permissible when it complies with GAAP, but managers’ perceptions of its ethicality vary. We theorize that codes of ethics and ethical beliefs shape managers’ view of the ethicality of EM and their use of justification. We then investigate how both ethical frameworks interact with justification to influence EM. We examine a setting where managers can justify that the company will also benefit from EM. We find that instead of constraining EM, rules-based codes accentuate it when the company also benefits. The effect is not observed for consequences-based codes. We also find that managers whose ethical beliefs predispose them to seek justification when they see EM as dishonest are more likely to manage earnings when the company also benefits. Implications for the design of codes and manager training and selection are discussed. Data Availability: Available on request. JEL Classifications: M40; M41.