Detective Chief Inspector April Casburn, 53, was told she would have received three years if she was not currently in the process of adopting a child.
Sentencing her at the Old Bailey on Friday, Mr Justice Fulford told her it was "a corrupt attempt to make money out of sensitive and potentially very damaging information".
Casburn has tried to frame her actions as whistleblowing but the judge disagreed.
He said: "If the News of the World had accepted her offer, it's clear, in my view, that Ms Casburn would have taken the money and, as a result, she posed a significant threat to the integrity of this important police investigation."
The judge added: "Activity of this kind is deeply damaging to the administration of criminal justice in this country.
"It corrodes the public's faith in the police force, it can lead to the acquittal or the failure by the authorities to prosecute individuals who have committed offences whether they are serious or otherwise.
"We are entitled to expect the very highest standards of probity from our police officers, particularly those at a senior level.
"It is, in my judgment, a very serious matter indeed when men or women who have all the benefits, privileges and responsibilities of public office use their position for corrupt purposes."
He said he was particularly concerned about Casburn's child, and admitted that her absence while she is in prison could be damaging.
But he said that, had she not been arrested, the detective would have returned to work by now, and therefore the child would be cared for by others anyway.
Casburn, from Hatfield Peverel in Essex, called the NotW news desk on September 11, 2010, and spoke to journalist Tim Wood about the fresh investigation into phone hacking.
She claimed she contacted the tabloid because she was concerned about counter-terror resources being wasted on the phone-hacking inquiry, which her colleagues saw as "a bit of a jolly".
The detective denied asking for money, but Wood had made a note that she "wanted to sell inside information".
Today Mr Justice Fulford said: "It seems to me Wood was a reliable, honest and disinterested witness.
"He took time and trouble during the defendant's call to find out exactly what Miss Casburn was saying, questioning the defendant in detail on her account in order to make an accurate note for his superiors at the News of the World which he wrote up in detail immediately afterwards.
"He had absolutely no reason to lie and every cause to be cautious given the risk that the newspaper was to be the victim of a sting, as he suspected."
During her trial at Southwark Crown Court last month, Casburn likened the male-dominated counter-terrorism unit to the TV series Life On Mars.
She was not given a desk for several months, despite more junior colleagues having them, jurors were told.
But the judge rejected this as an explanation for her behaviour.
He said: "It seems to me this is a straightforward but troubling case of corruption.
"I decline to accept that she had significant difficulties working with her male colleagues in the senior ranks of the counter-terrorism unit, which in part she said led her to act as she did.
"The most that could be said is that she was a relative newcomer to this area of police work. As a result she may have felt something of an outsider."
But he said this "could not begin to explain the actions of a detective chief inspector who offers to the very newspaper which is the subject of a sensitive and confidential investigation by other officers to sell details of the progress of the inquiry and the strategy that officers were intending to follow".