jsoup is an open-source Java library for parsing, extracting, editing, and sanitising real-world HTML and XML, built for JVM developers who need browser-grade parsing and XSS-safe content handling inside their own applications.
What it is
jsoup is a Java HTML parser distributed under the MIT licence and maintained by Jonathan Hedley and contributors since 2009. It implements the WHATWG HTML5 specification and parses documents into the same DOM that modern browsers produce, so the resulting tree behaves the way a developer expects from browser DevTools or client-side JavaScript. It handles the full spread of markup found in the wild, from pristine and validating documents to broken tag-soup, and in every case produces a sensible parse tree rather than throwing. The project lives on the JVM, is published as org.jsoup:jsoup, and carries topics including java-html-parser, css-selectors, xpath, dom, parser, and web-scraping. It is listed at 11,393 stars, 2,297 forks, and 4 open issues, and is described as a general, stable release.
The concrete problem it solves is turning arbitrary HTML into something a program can navigate and trust. Without it, a JVM application that needs page content must choose between brittle string handling and a strict XML parser that rejects malformed markup outright. jsoup replaces that bespoke parsing code with a single API that reads from a URL, a file, or a string, and it replaces hand-rolled filtering of user input with a safelist-based cleaner. That covers both directions of the problem: getting messy HTML in and shaping produced HTML before it goes out.
Key capabilities
- Fetches and parses HTML directly from a URL, file, or string, for example
Jsoup.connect("https://en.wikipedia.org/").get() returning a Document.
- Selects nodes through DOM traversal, CSS selectors, or XPath, for example
doc.select("#mp-itn b a") returning Elements.
- Manipulates HTML elements, attributes, and text, and emits tidy HTML through
Element.html().
- Cleans untrusted, user-submitted content against a safelist to prevent XSS attacks.
- Parses invalid tag-soup into the same DOM structure as modern browsers under the WHATWG HTML5 spec.
- Handles XML alongside HTML, with topics covering both
html and xml.
- Runs on Android when core library desugaring with the NIO specification is enabled for Java 8+ features.
Who uses it and how
- Java and JVM teams scraping pages: connect to a URL, select with CSS or XPath, log or store the extracted fields.
- Backend services that accept user-submitted HTML, running it through the safelist cleaner before storing or rendering it.
- Android applications, provided the build enables core library desugaring and the NIO specification.
- Data extraction and web scraping work, the registry category the project sits in, where parsed DOMs feed downstream analytics.
- Research and technical documentation, since jsoup is citable as "Jonathan Hedley & jsoup contributors. jsoup: Java HTML Parser (2009–present)" with a supplied BibTeX entry.
Getting started
Download the latest jsoup jar from jsoup.org/download or add the dependency to a Maven or Gradle build — Maven uses org.jsoup:jsoup:1.23.2 and Gradle uses implementation 'org.jsoup:jsoup:1.23.1', with the latest release tagged jsoup-1.23.1. The README then points to the cookbook introduction for first steps, and questions go to jsoup Discussions while bugs go to the issue tracker after checking for duplicates.
How it compares
The supplied facts name no competing product, hosted service, or paid alternative, so no licence, cost, or self-hosting comparison can be drawn from them. On the evidence available, jsoup stands alone in this registry.
When to use it — and when not to
Because jsoup is a library rather than a service, a team adopting it operates nothing extra: there is no database, storage layer, or SMTP dependency to run, only a JVM build that includes the artifact, plus desugaring configuration on Android. Teams outside the JVM, or those wanting a managed scraping product with no code to write, should not pick it, and the facts describe no CLI, server, or hosted offering. The honest caveat is that everything the page can claim rests on a short README and a topic list: the licence and release status are clear, but operational detail beyond the library API is thin.
project readme (upstream, from github) — read inline
jsoup: Java HTML Parser
jsoup is a Java library that makes it easy to work with real-world HTML and XML. It offers an easy-to-use API for URL fetching, data parsing, extraction, and manipulation using DOM API methods, CSS, and xpath selectors.
jsoup implements the WHATWG HTML5 specification, and parses HTML to the same DOM as modern browsers.
jsoup is designed to deal with all varieties of HTML found in the wild; from pristine and validating, to invalid tag-soup; jsoup will create a sensible parse tree.
See jsoup.org for downloads and the full API documentation.

Example
Fetch the Wikipedia homepage, parse it to a DOM, and select the headlines from the In the news section into a list of Elements (online sample, full source):
Document doc = Jsoup.connect("https://en.wikipedia.org/").get();
log(doc.title());
Elements newsHeadlines = doc.select("#mp-itn b a");
for (Element headline : newsHeadlines) {
log("%s\n\t%s",
headline.attr("title"), headline.absUrl("href"));
}
Open Source
jsoup is an open source project distributed under the liberal MIT license. The source code is available on GitHub.
Getting Started
- Download the latest jsoup jar (or add it to your Maven/Gradle build)
- Read the cookbook introduction.
- Enjoy!
Maven:
<dependency>
<!-- jsoup HTML parser library @ https://jsoup.org/ -->
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.23.2</version>
</dependency>
Gradle:
// jsoup HTML parser library @ https://jsoup.org/
implementation 'org.jsoup:jsoup:1.23.1'
Android Support
When used in Android projects, core library desugaring with the NIO specification should be enabled to support Java 8+ features.
Development and Support
If you have any questions on how to use jsoup or have ideas for future development, please get in touch via jsoup Discussions.
If you find any issues, please file a bug after checking for duplicates.
The colophon talks about the history of and tools used to build jsoup.
Status
jsoup is in general, stable release.
Author
jsoup was created and is maintained by Jonathan Hedley, its primary author.
jsoup is an open-source project, and many contributors have helped improve it over the years. You can see their contributions and join the development on GitHub.
Citing jsoup
If you use jsoup in research or technical documentation, you can cite it as:
Jonathan Hedley & jsoup contributors. jsoup: Java HTML Parser (2009–present). Available at: https://jsoup.org
@misc{jsoup,
author = {Jonathan Hedley and jsoup contributors},
title = {jsoup: Java HTML Parser},
year = {2026},
url = {https://jsoup.org}
}