The invention discloses a two-dimensional code generation method and system and a document anti-counterfeiting method and system, and the method comprises the following steps: obtaining to-be-stored information, and obtaining a matched two-dimensional code template based on the to-be-stored information; generating first coded data corresponding to the two-dimensional code template based on the to-be-stored information, wherein the first coded data comprises a data code sequence and an error correction code sequence; performing interference processing on the error correction code sequence to obtain a corresponding interference sequence, and the interference sequence comprises a true error correction code and a false error correction code; and generating a corresponding two-dimensional codeon the two-dimensional code template based on the data code sequence and the interference sequence, wherein the two-dimensional code comprises a completely colored first pixel block and a partially colored second pixel block. According to the invention, by interfering the error correction code sequence and combining the design of the second pixel block, the generated two-dimensional code has certain vulnerability, pixels are easier to lose in the copying process, and unreadable copying is realized.