A random code length polar encoding method includes: during construction of a polar code, if the code length is not the power of 2, using a group of virtual channels with the capacity of zero for supplementing the channel number to be the power of 2; performing mixed mapping for each channel according to the capacity equalization principle; and performing polar conversion for the obtained channels, selecting the channels with higher capacity from converted channels according to the designed bitrate for transmitting information bit sequences, and using the rest channels for transmitting a known fixed bit sequence of a receiving end and a transmitting end. The method enables polar encoding to allow the code length to be an optional positive integer and is applicable to multi-carrier and high-order modulation systems, and the added perforating operation enables the encoding bit sequences outputted by an encoder to be optional in length; by means of channel mixed mapping, polar encoding can adapt to different component channels of parallel channels, so that anti-noise performance is good; and flexibility of using polar codes for a practical digital communication system is greatly improved, and accordingly the method has good application prospect.