Xcode free space requirement
You'll need about 20GB free to do the install when you consider the space needed for holding/swapping files with the .dmg during the install process.
I saw this in the Apple developer forums:

Have a look at About This Mac → Storage tab.  You might see a purple
segment labeled &quot;Backups.&quot;  That's the local Time Machine cache, and
it doesn't show up in the Finder's free space display because it can
theoretically be purged if that space is needed.

Update Sept 18, 2020: Since this answer was written, Xcode free space requirements have been increasing.  As of Xcode 12, I needed at least 49GB of space to complete the installation.