Health level 7 (HL7) is the standard of electronic data interchange in the health domain. We have developed a web-based message generation and validation system for testing the message format of the data exchange among hospitals and health organizations. Compared with other existing ones, this system has incorporated several novel functions that optimize medical data exchange and helps medical students in learning HL7 messages. When receiving HL7 message from another system with the hypertext transmission protocol or accepting an uploaded HL7 message file, the system shows the validation result through a web browser. In this platform, users may input and edit medical data on-line to test and generate standard HL7 messages. The system supports various data formats and is capable of transforming HL7 messages between the standard delimiter format and the extensible markup language format. This system has been successfully passed our system evaluation among 139 student users for HL7 training. Most of the users agreed that the system is helpful for medical data exchange.