user: Q: Melanie Woolcock was sentenced to 81 days in prison by Bridgend magistrates in July 2016 for failing to pay £10 a week towards her debt.
She spent 40 days behind bars before being released on bail.
In a decision on Wednesday, Mr Justice Lewis ruled she should never have been imprisoned.
London's High Court heard that Miss Woolcock owed more than £4,700 in council tax.
She had been ordered to pay off the debt at a rate of £10 a week but she said she was too sick to work and struggled to pay rent and feed herself and her teenage son.
After she failed to keep up instalments, Bridgend magistrates ordered her imprisonment on 18 July.
'No culpable neglect'
Bailiffs arrived on her doorstep on 8 August and although by then she had paid £100 towards the debt, she was told it was "too late".
She was arrested by two police officers and had to phone her mother to ask her to look after her son.
Miss Woolcock was then driven to Bridgend police station, and from there to a prison in Gloucestershire, where she spent 40 days.
She was released on bail on 16 September after lawyers launched emergency proceedings.
Ruling her committal to prison unlawful, Mr Justice Lewis said: "There was no evidential basis on which the magistrates' court could conclude that there had been culpable neglect in non payment."

A: A Porthcawl woman was unlawfully jailed for not paying council tax, a High Court judge has ruled.


Q: Thomas Mair, 53, from Birstall, remained silent when asked to plead at the Old Bailey on four charges relating to Mrs Cox's death.
Mrs Cox, 41, who was a married mother-of-two, was shot and stabbed in Birstall, West Yorkshire, in June.
In the light of Mr Mair's silence, the judge ordered that not guilty pleas should be entered on his behalf.
The defendant is accused of murder, grievous bodily harm, possession of a firearm with intent to commit an indictable offence and possession of an offensive weapon - a dagger.
Read more about this and other stories from across West Yorkshire
He appeared via video-link from Belmarsh prison and spoke only to confirm his name.
Members of Mrs Cox's family were in court to witness proceedings.
The judge, Mr Justice Wilkie, adjourned the case for a further hearing on 28 October and a provisional date for a  four-week trial has been fixed for 14 November.
Mrs Cox, who was elected MP for Batley and Spen at the 2015 General Election, was about to attend a constituency surgery when she was killed on June 16.
Her death prompted what her family described as an "outpouring of genuine grief and sympathy".
The then Prime Minister David Cameron said Mrs Cox was a "bright star" and Labour leader Jeremy Corbyn described her as "a much loved colleague".
She had grown up in the area, attending Heckmondwike Grammar School, before attending Cambridge University.
Prior to entering Parliament Mrs Cox had worked for a number of charities including Oxfam, Save the Children and the NSPCC.

A: A man accused of killing the Labour MP Jo Cox refused to enter pleas as he appeared in court.


Q: Scorch damage was caused to Katie Greer's house in Nelson Drive some time between Sunday night and Monday afternoon.
Ms Greer believes she could have been seriously injured in the attack.
"I have no idea why my house would have been targeted in the first place," she said.
Ms Greer said that because of an underlying health condition, she was asleep when the attack happened.
"I was in my bed, I've got fibromyalgia," said Katie Greer, "As soon as I opened my front door it was completely charred."
"Everything in the porch and front door was burnt right up to my roof.
"It has made me feel really unsettled but I really like this area and I don't want to have to move out of this area.
DUP councillor Drew Thompson condemned the attack.
"I can't understand the motive behind this attack, it is completely unjustified.

A:

assistant: A woman whose home was targeted in an arson attack in the Waterside area of Londonderry has said she will not be intimidated into moving out.