The invention relates to a method and a device for measuring and representing the compression coefficient and the expansion coefficient of a material on line. A temperature sensor, a pressure sensor and an ultrasonic probe are respectively arranged on one cross section of a closed material cavity of a pressure-volume-temperature (PVT) calibration device and are used for testing the volume, the temperature T, the pressure P and ultrasonic signals of the closed material synchronously. The sound velocity of the ultrasonic wave, which passes through the material with the thickness l in the material cavity is c=l / delta t within the propagation time delta t; the temperature is maintained constant, and the pressure measurement volume is changed, so that a constant temperature compression coefficient can be obtained; the pressure is maintained constant, and the temperature measurement volume is changed, so that a constant pressure expansion coefficient can be obtained; a material specific volume, a compression coefficient or expansion coefficient and sound velocity correspondence curve is established, and a corresponding equation is obtained by regression; or the compression coefficient (alpha) and the expansion coefficient (beta) can be obtained by the specific volume curve or the state equation. At certain temperature and under certain pressure, the propagation velocity of the ultrasonic wave in the material can be tested on line, and the compression coefficient and the expansion coefficient at the temperature and under the pressure can be obtained by the established corresponding curve or corresponding equation. The method has the advantages of being lossless and being easy in online representation, and the device is simple and convenient to install.