While both words refer to a storage space with shelves, "cupboard" is more common in British English, while "closet" is more common in American English.
While both words refer to a storage space with shelves, "cupboard" is more common in British English, while "closet" is more common in American English.