Need info about U.S. Federal Employer ID validation

I’m working on a project where we’ll need to validate that the Federal Tax IDs we have on file are probably valid.

We have a lot of junk that is tagged as a Federal ID. As part of this project, we want to identify anything that is definitely garbage.

We have rules that tell us whether an ID could be an SSN, but haven’t found anything that could tell us how to weed out anything that’s definitely not a tax ID.

My team has tapped our usual internal resources and come up empty. I’ve done a little bit of Googling and skimmed a couple of federal web sites, but haven’t found anything useful.

Any Dopers out there with experience in this area?

Initially, we just need to tell whether it’s probably a valid FEIN. Eventually, I’d like to validate that I have it associated with the right party. This project is being done for a state agency, if that makes a difference.

Any hints, resource recommendations, other help?

Thanks in advance!