The invention discloses a text alignment method and device, electronic equipment and a computer readable storage medium, and the method comprises: presetting a formatting alignment template, a preset keyword, a search direction, a search region and a preset corresponding check expression of a text according to a task type, and carrying out the keyword recognition and text type recognition of the text, such as a picture, through an OCR module, obtaining a text region containing position information; then performing adjacent search matching, identifying each keyword and a matching value according to a preset search direction and a search area, performing verification according to a preset verification expression, performing qualification judgment according to a preset judgment rule, performing matching output after qualification, and finally performing fault tolerance and final verification processes. The accuracy of alignment of various text keywords and matching values is further ensured. The technical problems that in the prior art, typesetting is changeable, formatting with large noise cannot be aligned, manual operation is slow, and formatting efficiency is seriously affected are thoroughly solved.