Generally, a voluntary confession to police isn't inherently invalid, but its use in a trial is a complicated matter. The key factor is whether it was obtained fairly. Investigators must adhere to specific rules, https://panchanandshaw.com/blog/confession-before-police-is-it-valid/