An in-line data compression system which reduces the number of binary bits required to transmit a given text or similar message over a data network such as Telex or TWX. The compression unit can transmit or receive standard messages or can transmit compressed and encrypted messages to remote stations decrypt, and decompress messages from remote stations. The text data is compressed by identifying each word, searching for the word in a fixed library of words, and transmitting a first escape code plus the library address if the word is found. If the word is not found in the fixed library, a search is made for the word in a reconfiguration library and a second escape code plus the reconfiguration library address is transmitted if the word is found. If the word is not found in the reconfiguration library, the word is transmitted one character at a time using variable length character codes produced by a "Huffman" type code generator. The reconfiguration library is compiled by placing each word which is not in the library in the reconfiguration library before it is transmitted by variable length code. Then the second and each subsequent time that the same word is found in the message, the second escape code plus the address in the reconfiguration library will be transmitted in lieu of the Huffman coded characters of the word. The system is also applicable to compression of other types of data, serial or parallel, such as digital color television, for example.