A method for watermarking documents comprising:identifying and locating spaces in a received original document (10) by a location analysis (110) module which distinguishes between intra-word spaces and inter-word spaces;minimizing an error probability of interference between intra-word spaces and inter-word spaces in the watermarked document (20) by an optimization module (111);encoding (113) the message (30) into codewords and encoding (114) the codewords into the watermark;embedding the watermark to generate (115) the watermarked document (20) by modifying the intra-word spaces and inter-word spaces of the original document (10).