The invention relates to a method and a device for optimizing data placement to reduce data fragments. The method comprises the following steps of: carrying out data partitioning on each file to be backed up, and determining a data block fingerprint of each data block to be backed up; organizing a plurality of continuous data blocks to be backed up into a data segment to be backed up; searching whether the data block same as that backed up by the backed-up data segment in the system as to each data block to be backed up in the data segment to be backed up, if not, judging the data block to be a non-repeated data block, entering a data reading and writing step, if so, judging the data block to be a repeated data block, and entering the next step; calculating the data redundancy locality of the data segment to be backed up and the backed-up data segment, and quantifying the data redundancy locality, if the value of the data redundancy locality is smaller than a preset threshold, entering the data reading and writing step, or else, entering the next step; and deleting the repeated data block shared by the data segment to be backed up and the backed-up data segment from the data segment to be backed up. According to the method disclosed by the invention, non-sequenced placement of the data and the data fragment are reduced; deterioration of the data fragment is slowed down under the premise of sacrificing a little of data compression ratio; and the reading and writing performance of the system is improved.