A method of optically reading out a barcode of a target using an area sensor, the barcode being composed of linearly-aligned parallel bars, the method comprising: obtaining an image of the target to thereby optically read out the barcode from the image; binarizing the optically readout barcode to thereby obtain a barcode pattern as a binarized representation of the captured image, the barcode pattern being composed of black bars and white bars; extracting an area in which the readout barcode pattern is located from the image of the target; and drawing one scanning line on the extracted area along a length direction of the barcode, characterized by tracing an extending direction of black bars located at both ends of at least a part of the whole readout barcode pattern scanned by a scanning line, the scanning line passing on the at least part of the readout barcode pattern; determining whether the extending direction of the black bars located at both ends of the at least part of the readout barcode pattern are not parallel to each other; and if the extending directions of the black bars located at both ends of the at least part of the readout barcode pattern are not parallel, performing the following steps: obtaining an outline (ABCD) of the at least part of the barcode pattern scanned by the one scanning line; determining an amount of a margin, which has been stipulated by a type of the barcode, based on the outline (ABCD) to thereby obtain first and second margin regions (AA'B'B) (CC'D'D) based on the determined amount of the margin, the obtained first and second margin regions being located at external sides of both ends of the outline; setting a plurality of check lines on each of the first and second margin regions at different positions in a height direction of the barcode pattern so as to extend outwardly from both ends of the outline, the height direction corresponding to a direction of a height of each parallel bar; and determining whether the reading of the barcode is good based on a determination of whether the amount of the margin is ensured along individually each of the plurality of check lines. obtaining an image of the target to thereby optically read out the barcode from the image; binarizing the optically readout barcode to thereby obtain a barcode pattern as a binarized representation of the captured image, the barcode pattern being composed of black bars and white bars; extracting an area in which the readout barcode pattern is located from the image of the target; and drawing one scanning line on the extracted area along a length direction of the barcode, characterized by tracing an extending direction of black bars located at both ends of at least a part of the whole readout barcode pattern scanned by a scanning line, the scanning line passing on the at least part of the readout barcode pattern; determining whether the extending direction of the black bars located at both ends of the at least part of the readout barcode pattern are not parallel to each other; and if the extending directions of the black bars located at both ends of the at least part of the readout barcode pattern are not parallel, performing the following steps: obtaining an outline (ABCD) of the at least part of the barcode pattern scanned by the one scanning line; determining an amount of a margin, which has been stipulated by a type of the barcode, based on the outline (ABCD) to thereby obtain first and second margin regions (AA'B'B) (CC'D'D) based on the determined amount of the margin, the obtained first and second margin regions being located at external sides of both ends of the outline; setting a plurality of check lines on each of the first and second margin regions at different positions in a height direction of the barcode pattern so as to extend outwardly from both ends of the outline, the height direction corresponding to a direction of a height of each parallel bar; and determining whether the reading of the barcode is good based on a determination of whether the amount of the margin is ensured along individually each of the plurality of check lines.