Each micro:bit has a unique five-character name assigned to it that you might see when you are using Scratch or connecting via Bluetooth. The names are hard-coded and based on their internal unique ID, so you can't manually rename the micro:bits.
Displaying the name of the micro:bit on the LED screen
You can find out the name of your micro:bit in MakeCode by using the `device name` block.
Finding the name of the micro:bit from the pairing pattern
You can also find the name, by looking at the barcode in pairing mode:
The name is set in the micro:bit runtime and derived from the micro:bit's serial number