Open the site and drag and drop HTML file to optimize and compress it online. Or just use a code sample in Java. Install Aspose.Words Cloud for Java Add a library reference (import the library) to your Java project Configure API using your app keys Load the source HTML to compress Compress HTML, clean unused information Select the output file format Get the result of HTML compression as a separate file