A Luxembourg company carries two numbers that are constantly confused. They are issued by two different authorities, they say different things, and neither can be worked out from the other.
The RCS number
The Trade and Companies Register assigns a number to every entity on registration: a section letter followed by up to six digits, for example B65282. It never changes — not on a change of name, not on a move, not on a change of manager — and it is not reissued to another entity after a striking-off.
The letter is the register section. B is commercial companies and covers nearly every entity; you will also meet F for branches, C for civil companies, and A for sole traders. It is part of the number: B18902 and F18902 are different entities.
This is the number to use to identify a company unambiguously. Names resemble each other, names change, and several companies can carry very similar ones; an RCS number points at one entity only.
The VAT number
The Registration Duties, Estates and VAT Authority issues a VAT identification number to taxable persons, in the form LU plus eight digits. Registration becomes compulsory above the statutory turnover threshold; below it, it remains possible voluntarily.
So not every company has one. A holding company carrying out no VAT-able transactions may perfectly well never have registered, and that says nothing about how sound it is.
How to check each
The VAT number is checked in the European Commission's VIES system. It is free, instant, valid for the whole EU, and it answers the only question that matters: is this number valid at the moment I ask. Checking the one on a new partner's invoice is a useful habit — an invalid number can cause problems when deducting input VAT.
The RCS number is checked with the Trade and Companies Register, free, one entity at a time. On this site it is the key: every company profile is built around it, and it is what sits at the end of every profile URL, so a link stays valid even after a change of registered name.
The confusion to avoid
Neither is derivable from the other. You do not make a VAT number by putting “LU” in front of an RCS number: the two authorities number separately. A site that shows you a VAT number without having checked it in VIES is showing you a guess, not a datum.