The technical specification for the JPEG File Interchange Format format is provided in both a PostScript and an ASCII version:
JFIF.TXT is a plain ASCII version of the specification file.
The JPEG FAQ may also be helpful.
Copyright © 1996 O'Reilly & Associates, Inc. All Rights Reserved.