If you want to convert a small space into a half bath, the general rule of thumb is that there should be a 3-foot radius around each appliance. The term "appliance" does not just apply to the sink and the toilet; it also applies to the door, assuming that it opens into the bathroom.
Proper Clearance Around Appliances
The term also extends to cupboards. In order for the space to be practical, you need to be able to open these doors fully, without hitting any other appliance. For a basic half bath with a toilet, sink, and door, the minimum space is 9x9-feet.