Due to the ever-increasing amount of data collected and the requirements for the rapid and reliable exchange of information across many interconnected communication devices, land-based communications networks are experiencing continuous progress and improvement of existing infrastructures. However, maritime communications are still characterized by slow communication speeds and limited communication capacity, despite a similar trend of increasing demand for information exchange. These limitations are particularly evident in digital data exchange, which is still limited to relatively slow and expensive narrowband satellite transmission. Furthermore, with the increasing digitalization of ships and introducing the sustainable concept of autonomous ship operation, large amounts of collected data need to be transmitted in real-time to enable remote voyage monitoring and control, putting additional pressure on the already strained means of maritime communications. In this paper, an adaptive shipboard data compression method based on differential binary encoding is proposed for real-time maritime data transmission. The proposed approach is verified on the actual data collected on board a training ship equipped with the latest data acquisition system. The obtained results show that the proposed data encoding method efficiently reduces the transmitted data size to an average of 3.4% of the original shipboard data, thus significantly reducing the required data transmission rate. Moreover, the proposed method outperforms several other tested competing methods for shipboard data encoding by up to 69.6% in terms of compression efficiency. Therefore, this study suggests that the proposed data compression approach can be a viable and efficient solution for transmitting large amounts of digital shipboard data in sustainable maritime real-time communications.