The final twelve contestants, which include Frankie Cocozza and Janet Devlin, will record a cover of Rose Royce's 1978 hit Wishing on a Star.
The song will be available to download after it is performed on an upcoming live show.
All proceeds raised from the download will go to help the ACT and Children's Hospices UK.
X Factor boss Simon Cowell said in a statement: 'I've seen the amazing work they do for kids and their families who need help and support.'
He added: 'I am thrilled that the X Factor charity single this year will benefit this charity.'