Provided is a terminal device used in a software rewriting system for rewriting software for a control device, the terminal device being provided with a storage unit for storing text-format source code for generating binary-format object code that can be executed on the control device. The terminal device: acquires difference source code stored in the storage unit, the difference source code being source code differing with respect to the source code that corresponds to the current object code generates most-recent source code from the acquired difference source code and the source code stored in the storage unit converts the generated most-recent source code into most-recent object code and transmits the converted most-recent object code to the control device.