To verify that a file matches a formal specification.
A valid file obeys all the rules of the specification. This guarantees that it can be used by any program that also properly follows that specification.
A file that is not valid may cause a program reading it to reject the file, or might even crash the program or device.
Also see: QA, field testing.