F1 teams are assigned numbers based on the highest of their two drivers' finishing position in the previous year's World Driving Championship. The team with the defending champion gets numbers 1 and 2, and so forth down through the standings.
Chat with our AI personalities
The drivers themselves aren't assigned car numbers. It's the team they race for that purchases the number from NASCAR.
Normally they get it from NASCAR or the racing company, like Stewart-Haas Racing. They can also get it from the old car number they could have driven.
NASCAR owns the rights to each car number. They license them to each team annually. Usually if a driver leaves a certain team, the team will retain the number.