The answer is in the JavaDoc of the equals() method:

Unlike compareTo, this method considers two BigDecimal objects equal only if they are equal in value and scale (thus 2.0 is not equal to 2.00 when compared by this method).

In other words: equals() checks if the BigDecimal objects are exactly the same in every aspect. compareTo() "only" compares their numeric value.

As to why equals() behaves this way, this has been answered in this SO question.

Answer from Joachim Sauer on Stack Overflow
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › math › BigDecimal.html
BigDecimal (Java Platform SE 8 )
October 20, 2025 - The results of this constructor ... equal to 0.1 (an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625....
🌐
Baeldung
baeldung.com › home › java › core java › bigdecimal equals() vs. compareto()
BigDecimal equals() vs. compareTo() | Baeldung
May 2, 2024 - The documentation refers to BigDecimal and its unusual behavior in the Comparable interface: One exception is java.math.BigDecimal, whose natural ordering equates BigDecimal objects with equal numerical values and different representations (such ...
🌐
Tutorialspoint
tutorialspoint.com › java › math › bigdecimal_equals.htm
Java.math.BigDecimal.equals() Method
The following example shows the usage of math.BigDecimal.equals() method. package com.tutorialspoint; import java.math.*; public class BigDecimalDemo { public static void main(String[] args) { // create 3 BigDecimal objects BigDecimal bg1, bg2, bg3; bg1 = new BigDecimal("235.00"); bg2 = new BigDecimal("235.00"); bg3 = new BigDecimal("235"); // create 2 boolean objects Boolean b1,b2; // assign the result of equals method to b1, b2 b1 = bg1.equals(bg2); b2 = bg1.equals(bg3); String str1 = bg1 + " equals " + bg2 + " is " +b1; String str2 = bg1 + " equals " + bg3 + " is " +b2; // print b1, b2 values System.out.println( str1 ); System.out.println( str2 ); } }
🌐
Medium
bterczynski.medium.com › comparing-bigdecimals-for-equality-71037fa2ee1d
Comparing BigDecimals for Equality | by Brian Terczynski | Medium
January 23, 2022 - I decided to verify that by printing ... my two BigDecimal numbers bdy - bdx , and sure enough the result was 0.0 . Furthermore, if I looked in the debugger at the value of bdz = bdy - bdx , the value of bdz was all zeroes as expected: So then I decided to look at the Javadoc for the == (equals()) method ...
🌐
Tabnine
tabnine.com › home page › code › java › java.math.bigdecimal
java.math.BigDecimal.equals java code examples | Tabnine
Two big decimals are equal if their unscaled value and their scale is equal. For example, 1.0 (10*10-1) is not equal to 1.00 (100*10-2). Similarly, zero instances are not equal if their scale differs.
🌐
GeeksforGeeks
geeksforgeeks.org › java › bigdecimal-equals-method-in-java
BigDecimal equals() Method in Java - GeeksforGeeks
December 4, 2018 - Input: b1 = new BigDecimal("4743.00") b2 = new BigDecimal("4743.00000") Output: false Input: b1 = new BigDecimal(4743) b2 = new BigDecimal("4743") Output: true Below programs illustrate equals() method of BigDecimal class: Program 1: ... // Java program to demonstrate equals() method import java.io.*; import java.math.*; public class GFG { public static void main(String[] args) { // Creating 2 BigDecimal objects BigDecimal b1, b2; b1 = new BigDecimal("4743.00"); b2 = new BigDecimal("4743.00000"); if (b1.equals(b2)) { System.out.println(b1 + " and " + b2 + " are equal."); } else { System.out.println(b1 + " and " + b2 + " are not equal."); } } }
🌐
EqualsVerifier
jqno.nl › equalsverifier › errormessages › bigdecimal-equality
BigDecimal equality - EqualsVerifier
January 26, 2026 - EqualsVerifier can be used in Java unit tests to verify whether the contract for the equals and hashCode methods is met. ... Be aware that BigDecimal fields with values such as 1, 1.0, 1.00, …
🌐
Javatpoint
javatpoint.com › java-bigdecimal-equals-method
Java BigDecimal equals() method with Examples - Javatpoint
Java BigDecimal class · abs() add() divide() doubleValue() equals() floatValue() hashCode() intValue() intValueExact() max() min() movePointLeft() movePointRight() multiply() negate() Big Integer Class ·
Find elsewhere
🌐
Igor's Techno Club
igorstechnoclub.com › java-bigdecimal
The Pitfalls of Comparing BigDecimals in Java | Igor's Techno Club
After stripping the trailing zeros, both zero1 and zero2 have the same scale, and the equals() method correctly identifies them as equal. Comparing BigDecimals in Java can be tricky due to the behavior of the equals() method.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › math › BigDecimal.html
BigDecimal (Java SE 17 & JDK 17)
January 20, 2026 - The results of this constructor ... equal to 0.1 (an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625....
🌐
Educative
educative.io › answers › how-to-compare-two-bigdecimals-in-java
How to compare two BigDecimals in Java
The comparison can not be done ... the first BigDecimal is greater than the second BigDecimal. 0: when the first BigDecimal is equal to the second BigDecimal....
🌐
Java Development Journal
javadevjournal.com › home › bigdecimal equals versus compareto
BigDecimal equals versus compareTo | Java Development Journal
January 30, 2018 - Compares this BigDecimal with the specified Object for equality. Unlike compareTo , this method considers two BigDecimal objects equal only if they are equal in value and scale (thus 2.0 is not equal to 2.00 when compared by this method).
🌐
Tutorialspoint
tutorialspoint.com › home › java/math › bigdecimal compareto in java
BigDecimal compareTo in Java
September 1, 2008 - The java.math.BigDecimal.compareTo(BigDecimal val) compares the BigDecimal Object with the specified BigDecimal value. Two BigDecimal objects that are equal in value but have a different scale (like 2.0 and 2.00) are considered equal by this method.
🌐
Baeldung
baeldung.com › home › java › java numbers › check if bigdecimal value is zero
Check if BigDecimal Value Is Zero | Baeldung
January 16, 2024 - Sharp eyes may have already realized that the requirement “whether its value is equal to zero” has implied the solution: using the equals() method. Further, the BigDecimal class provides a convenient ZERO constant object to indicate the zero value.
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › math › BigDecimal.html
BigDecimal (Java Platform SE 7 )
The results of this constructor ... equal to 0.1 (an unscaled value of 1, with a scale of 1), but it is actually equal to 0.1000000000000000055511151231257827021181583404541015625....
🌐
Linux Hint
linuxhint.com › compare-two-bigdecimals-in-java
How to Compare Two BigDecimals in Java
Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
🌐
GeeksforGeeks
geeksforgeeks.org › java › bigdecimal-compareto-function-in-java
BigDecimal compareTo() Function in Java - GeeksforGeeks
June 25, 2018 - The BigDecimal.compareTo() method compares two BigDecimal objects based on their numerical value only, ignoring scale differences, and returns an integer indicating whether the current value is less than, equal to, or greater than the specified ...
🌐
Google Groups
groups.google.com › g › project-lombok › c › oRdyHiecgWE › m › GHLLhL8FYdIJ
equals() with BigDecimal
Now let's suppose I have a class containing BigDecimal, such as the obvious class Money { private BigDecimal amount; private String currency; } As the designer of Money I could choose that Money equality is not so strict, so this is the actual implementation of equals(): @Override public boolean equals (final Object object) { if ((object == null) || (getClass() != object.getClass())) { return false; } final Money other = (Money)object; return Objects.equals(this.currency, other.currency) && (this.amount.compareTo(other.amount) == 0); } Lombok's @EqualsAndHashcode always use a strict equals() comparison between the two instances of amount.