Sarah Catt, who was married but had been having an affair for seven years, was about 40 weeks pregnant when she took drugs she bought on the internet to induce her labour.
She claimed the baby was stillborn and she buried his body, but has since refused to tell anyone where to find her son.
Catt, who showed no emotion during the hour-long sentencing, was described as cold and calculating by police, who searched her home with dogs and specialist equipment to try to find the child's body.
Mr Justice Cooke said the seriousness of the crime lay between manslaughter and murder. He said she would have been charged with murder if the baby had been born a few days later and she had then killed him.
"The child in the womb was so near to birth that, in my judgment, all right-thinking people would consider this offence more serious than manslaughter or any offence on the calendar other than murder," he said.
"What you did was end the life of a child that was capable of being born alive, by inducing birth or miscarriage."
He added: "What you have done is rob an apparently healthy child, vulnerable and defenceless, of the life which he was about to commence."
Mr Justice Cooke said Catt ended the pregnancy with full knowledge of her due date and of the abortion law.
He said: "This was a cold, calculated decision that you took for your own convenience and in your self-interest alone."
Catt, 35, from Sherburn-in-Elmet, North Yorkshire, had previously given a baby up for adoption and terminated a pregnancy with the agreement of her husband. She also attempted to terminate another baby but was beyond the legal limit of 24 weeks and concealed a further pregnancy from her husband before the child's birth.
When she discovered she was pregnant again in 2009 she believed the father of the child was her lover and ended the relationship after telling him about the pregnancy. She restarted the "casual" affair in June the following year.
She had an appointment for a consultation at a Marie Stopes clinic on March 16, 2010, but a scan the day before showed she was 29 weeks and five days pregnant and too late for a termination.
Between March and May, she made several searches on the internet about illegal abortions and abortion drugs.
Catt was arrested in September 2010 and interviewed several times over the following year. She pled guilty earlier this year to administering a poison with intent to procure a miscarriage.
Contextual targeting label: