A shallow copy creates a new object but does not copy the nested objects. A deep copy creates a new object and recursively copies all nested objects.