Contextual output encoding for Java 8+ to help prevent XSS. Version 1.6.0 provides a zero-dependency core, String and Writer APIs, and optional javax/Jakarta JSP adapters.
OWASP Java Encoder 1.6.0 was released on October 18, 2026 and is available from Maven Central.
This release reduces unnecessary JavaScript letter escaping while retaining protection against recognized HTML tokens split across trusted and encoded fragments. Exact encoded output and low-level streaming behavior change; read the 1.6.0 migration notes before upgrading. Java 8 support, public APIs and runtime dependencies remain unchanged.
Keep encoder and your chosen JSP adapter at the same version. Use only one of the javax and Jakarta adapters. Release notes, signatures and checksums are linked under Project Resources. The ESAPI adapter remains retired.
OWASP Java Encoder provides contextual output encoding for Java 8 and later. Its core has no runtime dependencies and offers String and Writer APIs for HTML, JavaScript, JSON strings, CSS, XML, and URL components. Optional javax JSP and Jakarta JSP adapters provide tags and EL functions.
Choose the encoder for the parser context receiving the data, and encode raw values at the output boundary. Encoding is one part of XSS prevention alongside safe templates, URL validation, and other application controls. It does not sanitize HTML, validate URLs, serialize complete JSON documents, or replace SQL parameterization.
The project is maintained by Jim Manico and Jeremy Long; Jeff Ichnowski is the original author.
Add org.owasp.encoder:encoder:1.6.0 to your Maven dependencies, or use implementation("org.owasp.encoder:encoder:1.6.0") in Gradle. Import org.owasp.encoder.Encode and choose the method for the output context.
Maven:
<dependency>
<groupId>org.owasp.encoder</groupId>
<artifactId>encoder</artifactId>
<version>1.6.0</version>
</dependency>
For JSP, replace encoder with encoder-jsp (javax) or encoder-jakarta-jsp (Jakarta). Each adapter brings in core. Install only one adapter and align any separately managed core version with it.
OWASP Java Encoder is free, open-source software licensed under the BSD 3-Clause license. See LICENSE in the project repository for the complete terms and attribution.
The GitHub repository contains the current context guide, complete Java/JSP examples, API documentation links, compatibility matrix, changelog, and build instructions. Report ordinary bugs through GitHub Issues. Report suspected vulnerabilities privately through the repository Security Advisories page and follow the linked security policy. Contributions follow the repository contribution guide and the OWASP Code of Conduct.
Project Leader
Jeremy Long co-leads OWASP Java Encoder and coordinates project maintenance, releases, and security response with Jim Manico.
Project Leader
Jim Manico is the founder of Manicode Security, where he trains developers and organizations in secure coding. He is an OWASP Distinguished Lifetime Member, a Java Champion, and the author of Iron-Clad Java. He leads the OWASP AISVS, Cheat Sheet Series, Java HTML Sanitizer, and Java Encoder projects.
Recognizing key contributors who have made significant impact on this project.
Original Author
Original author of OWASP Java Encoder.