# Compare bookmarks in Word documents This article explains how to activate the comparison of bookmarks for Word format in GroupDocs.Comparison for Java. --- [GroupDocs.Comparison](https://products.groupdocs.com/comparison/java) allows you to compare bookmarks in the Word documents. To compare bookmarks in the Word documents, follow these steps: 1. Instantiate the [Comparer](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/) object. Specify the source file path or stream. 2. Call the [add()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#add-java.lang.String-) method. Specify the target file path or stream. 3. Instantiate the [CompareOptions](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison.options/compareoptions/) object. Set the [CompareBookmarks](https://reference.groupdocs.com/comparison/java/groupdocs.comparison.options/compareoptions/properties/comparebookmarks) property to `true`. 4. Call the [compare()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#compare-java.lang.String-) method. Specify the [CompareOptions](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison.options/compareoptions/) object from the previous step. The following code snippet shows how to demonstrate how to compare bookmarks: {{< tabs "example1">}} {{< tab "Java" >}} ```java import com.groupdocs.comparison.Comparer; import com.groupdocs.comparison.options.CompareOptions; import java.nio.file.Path; // ... try (Comparer comparer = new Comparer("source.docx")) { comparer.add("target.docx"); CompareOptions compareOptions = new CompareOptions(); compareOptions.setCompareBookmarks(true); final Path resultPath = comparer.compare("result.docx", compareOptions); } ``` {{< /tab >}} {{< /tabs >}} The result of compared bookmarks is as follows: ![](https://docs.groupdocs.com/comparison/java/images/compared-bookmarks.png)