> The copyright of a work belongs to its creator by default. (That's U.S. law; no contract is required to make that happen.)
If it meets the criteria for a work-for-hire, the contracting party is the creator from the beginning for copyright law purposes (this is significant for reasons other than those under discussion; copyright transfers can reversed by the legal creator during a legally-specified window that occurs a few decades after the transfer, but a work-for-hire can't be recovered this way by the actual creator, since they aren't the legal creator), and owns the copyright unless specific contract terms specify otherwise.
For contractors (in contrast to employees), it's not a "work for hire" by default. The contract must explicitly state that it's a "work for hire", and various other conditions must be met. From Wikipedia[1]:
On the other hand, if the work is created by an independent contractor or freelancer, the work may be considered a work for hire only if all of the following conditions are met:
- the work must come within one of the nine limited categories of works listed in the definition above, namely (1) a contribution to a collective work, (2) a part of a motion picture or other audiovisual work, (3) a translation, (4) a supplementary work, (5) a compilation, (6) an instructional text, (7) a test, (8) answer material for a test, (9) an atlas;
- the work must be specially ordered or commissioned;
- there must be a written agreement between the parties specifying that the work is a work made for hire by use of the phrase "work for hire" or "work made for hire."
It doesn't seem that software written by one person meets any of the nine criteria above. (A "collective work" seems to refer to something like a magazine that contains the writings of several authors.[2])
If it meets the criteria for a work-for-hire, the contracting party is the creator from the beginning for copyright law purposes (this is significant for reasons other than those under discussion; copyright transfers can reversed by the legal creator during a legally-specified window that occurs a few decades after the transfer, but a work-for-hire can't be recovered this way by the actual creator, since they aren't the legal creator), and owns the copyright unless specific contract terms specify otherwise.