1. A method for coding a two dimensional optical identification (2D-OID), the method comprising the steps of: providing a positioning block; providing a plurality of data coding blocks; disposing the data coding blocks around the positioning block; providing a plurality of specific patterns in the positioning block, wherein the specific patterns are arranged as an N×M matrix; providing the specific patterns in the data coding blocks, wherein the specific patterns are respectively arranged as the N×M matrixes in the data coding blocks, respectively; filling the specific patterns adjacent to a first edge of the positioning block, and filling the specific patterns adjacent to a second edge of the positioning block; filling at least one of the specific patterns in a center of the data coding blocks; and taking out and filling a specific number of the specific patterns from the remaining specific patterns in each of the data coding blocks according to to-be-stored data, and filling the specific number of the specific patterns, which are taken out, wherein N and M are natural numbers.