Tell your boss about the mistake before they find it. Same mistake, completely different story.
LEADERSHIP
LEADERSHIP
An error you report is a problem being handled. The same error discovered later is a problem plus a concealment, and the second part is what people actually react to. Nothing about the underlying facts changes, only who brought them into the room, and that detail decides whether you look reliable or evasive.
Say it early, plainly, with whatever you have already done about it. Skip the long explanation of how it happened until someone asks. Most people are far more forgiving about errors than about finding out from someone else.
Which mistake are you hoping nobody notices at work?
Free, with nothing to buy inside it.