When it comes time to negotiate your salary at a new job, you’ll probably hear some variation of this question: How much were you earning in your most recent position?

And you might wonder: How will they ever know? Can they even find out if I don’t tell them?

The answer is … it depends.

You can rest assured that there’s no way for your prospective employer to find out without your knowledge. If the company does not ask for W-2 forms or pay stubs to verify your previous salary (you’re under no obligation to provide them, but by refusing you run the risk of losing the offer), the company must have you sign authorization forms permitting your previous employer to disclose salary information, attorney Mitchell D. Kreiter tells Business Insider.

"Every state with the exception of Louisiana has the same basic principals of law, which do not permit a prospective employer to find out what the applicant's previous salary was unless they applicant has signed an authorization form permitting the prospective employer to do so," Kreiter says. "It should be noted that all federal laws in the United States are uniform."

On the other hand, the company might not be allowed to ask at all. Amy Glaser, a senior vice president at the Adecco Staffing USA employment agency, tells Business Insider that policies dictating how companies can ask about prospective employees' previous salaries vary among states and organizations. For example, Massachusetts in August became the first state to bar employers from asking job candidates about their previous earnings, in an effort to lessen the gender wage gap.

No matter where you are or what you're doing, Glaser says that it's not a good idea to lie about your past salary. Even if your prospective employer isn't prepared to shake down your past employers for salary information, any hiring manager worth their salt likely has a pretty good idea of your market value.

"It's best not to lie or inflate your current or desired salary, but instead take a hard look at what you need, what you want, and what you are willing to accept," Glaser says. "Moreover, candidates should keep in mind total compensation, including incentives like cell phone reimbursement, a company laptop, or PTO. When considering a job opportunity, be sure to look at the big picture."

Gretchen Van Vlymen, HR practice leader and director of account management at StratEx, a HR software firm, agrees that it's usually better to be honest with prospective employers, as many job application forms include statements along the lines of "everything on this application is true to my knowledge." If you're caught lying, you could face termination.

"Making unreasonable salary demands when moving from one similar role to another just isn't believable, and will do nothing to help the employee's credibility during the selection process," Van Vlymen told Business Insider. "Keep in mind that if the reason the candidate left their prior role is due to the fact that they felt they were not paid enough, it may be a good idea to actually tell the new employer about those feelings so that all parties are on the same page about priorities and expectations. At the end of the day, clear and transparent communication from both employer and employee makes for the best employment relationship, in general."

"Lying is never a good idea," Kreiter agrees. "Lies have very short legs. They never take you very far, and you are always tripping over them."