Against the shortcomings of hardware in data processing and of software in real-time performance, LZW algorithm is optimized and implemented in FPGA in the bulk-storage memory and lossless transmission process. Based on analyzing LZW algorithm, the calculation method is optimized in three aspects. The optimization is inspected and verified by simulation. The results show that the use of optimized LZW algorithm can deliver data compression execution speed and efficiency.