A BigDecimal is an exact way of representing numbers. A Double has a certain precision. Working with doubles of various magnitudes (say d1=1000.0 and d2=0.001) could result in the 0.001 being dropped altogether when summing as the difference in magnitude is so large. With BigDecimal this would not happen.

The disadvantage of BigDecimal is that it's slower, and it's a bit more difficult to program algorithms that way (due to + - * and / not being overloaded).

If you are dealing with money, or precision is a must, use BigDecimal. Otherwise Doubles tend to be good enough.

I do recommend reading the javadoc of BigDecimal as they do explain things better than I do here :)

Answer from extraneon on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › java numbers › java double vs. bigdecimal
Java Double vs. BigDecimal | Baeldung
January 8, 2024 - In contrast, BigDecimal presents a more extensive range of values and better precision across a wide array of values. There are also differences in memory usage. Java’s Double is more compact, which results in more efficient memory usage.
Discussions

Which of the following is the advantage of BigDecimal over double?
Which of the following is the advantage of BigDecimal over double? a) Syntax b) Memory usage c) Garbage creation d) Precision More on examveda.com
🌐 examveda.com
1
13
September 14, 2023
Double vs BigDecimal in financial programming

Use long or big decimal. Performance problems will most probably arise elsewhere before you factor a big decimal as the culprit

More on reddit.com
🌐 r/java
105
44
May 22, 2018
Расчет денег: Double против BigDecimal : r/javahelp
The advantage with BigDecimal isn't only that you don't get precision problems, you can also control rounding exactly (like always rounding up, down, towards even, ...) and you can easily limit all intermediate values to decimal 2 digits (if you want that), and so on. ... But why? If you write down double ... More on reddit.com
🌐 r/javahelp
Retaining BigDecimal Precision in JSON Without Converting to String
Well, technically speaking JSON does support any precision. All JSON cares about is "sequence of numeric digits." Its just that implementations in languages like Javascript do not, so for "compatibility" people generally use strings, since those can be massaged after the read step. More on reddit.com
🌐 r/rust
14
21
November 23, 2023
🌐
Reddit
reddit.com › r/java › double vs bigdecimal in financial programming
r/java on Reddit: Double vs BigDecimal in financial programming
May 22, 2018 -

Everyone says that BigDecimal should be used when dealing with money but it’s much slower and takes more memory than double. I would think this would be especially important in high frequency low-latency applications like trading. Do people actually use BigDecimal in such systems or do they use doubles with some kind of workaround to handle the precision issue?

Edit: I do have experience working on trading and risk systems and I see doubles used much more often than BigDecimal so I was curious to see if this is more common in actual practice. Most of the systems I worked on only need precision to the penny so I wonder if that’s the reason?

Also, BigDecimal is a pain to use and code written with it look much uglier than plain doubles.

🌐
Medium
medium.com › @qingedaig › java-bigdecimal-vs-double-vs-float-012c7149e550
Java BigDecimal vs double vs float | by Alice Dai | Medium
October 15, 2024 - Precision: Use BigDecimal for precise calculations, particularly in financial applications. Performance: Use double for general floating-point arithmetic when performance matters but precision is not critical.
🌐
Frankel
blog.frankel.ch › bigdecimal-vs-double
double, BigDecimal, or Fixed-Point?
June 14, 2026 - BigDecimal operations allocate ... scale and precision metadata at every step. Compared to double, which compiles down to a single FPU instruction, the overhead is enormous....
🌐
Codemia
codemia.io › knowledge-hub › path › double_vs_bigdecimal
Double vs. BigDecimal?
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
daily.dev
daily.dev › home › baeldung › java double vs. bigdecimal
Java Double vs. BigDecimal | daily.dev
September 22, 2023 - Java Double vs. BigDecimal can significantly impact performance as well as the precision and accuracy of floating-point numbers. In this tutorial, we’ll...
Find elsewhere
🌐
LinkedIn
linkedin.com › pulse › why-we-should-use-bigdecimal-instead-double-java-financial-ismail
Why we should use BigDecimal instead double in java for financial systems
May 17, 2022 - So if we have a system where low latency is crucial than the decimal part of a number, we should go for double. But in financial or any other systems where each digit of decimal part are important, BigDecimal should be chosen over double/float.
🌐
Medium
medium.com › @samrat.alam › stop-using-double-for-financial-system-in-java-bigdecimal-the-right-way-209d58ac673a
💰 Stop Using Double for Financial System in Java — BigDecimal The Right Way | by Samrat Alam | Medium
November 7, 2025 - A double in Java, follows the IEEE ... in binary. ... That’s a rounding artifact of binary floating-point. BigDecimal represents numbers in base-10, similar to how humans think about numbers....
🌐
Sps-tech
sps-tech.in › 2021 › 09 › how-to-compare-bigdecimal-and-double-in-java
How to compare BigDecimal and Double in Java - SPS Tech
Tutorials, deep dives, and best practices for Java developers at every level — from fundamentals to JVM internals · Java Was Always “Starts Slow, Runs Fast” — Until Now For years, Java carried a reputation that every backend engineer was familiar with: “It…
🌐
Javacodemonk
javacodemonk.com › set-precision-and-scale-for-a-double-value-in-java-9c8d56f4
Precision and scale for a Double in java
August 3, 2020 - There are multiple ways in Java to round the double value to certain scale, as mentioned in the below example, ... import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; public class RoundDouble { public double round1(double input, int scale) { BigDecimal bigDecimal = new BigDecimal(input).setScale(scale, RoundingMode.HALF_EVEN); return bigDecimal.doubleValue(); } public double round2(double input) { return Math.round(input * 100) / 100.0d; } public double round3(double input) { DecimalFormat df = new DecimalFormat("#.00"); return Double.parseDouble(df.format(input)); } public static void main(String[] args) { RoundDouble rd = new RoundDouble(); System.out.println(rd.round1(9232.129394d, 2)); System.out.println(rd.round2(9232.129394d)); System.out.println(rd.round3(9232.129394d)); } }
🌐
Upgrad
upgrad.com › home › blog › software development › difference between float and double in java: float vs double in java, similarities, and more
Float vs Double in Java: Key Differences & Similarities
July 7, 2026 - BigDecimal avoids floating-point errors by handling arbitrary-precision decimal values, making it ideal for currency transactions and financial applications. Yes, both float and double can represent numbers in scientific notation, e.g., 1.23e4.
🌐
Javaplanet
javaplanet.io › home › java.math › creation and initialization of bigdecimal objects
Creation and initialization of BigDecimal objects -
September 10, 2025 - valueOf(long, int) BigDecimal bd9 = BigDecimal.valueOf(12345L, 2); // creates 123.45 System.out.println("valueOf(long, int): " + bd9); // Sample arithmetic using these objects BigDecimal result = bd1.add(bd9); System.out.println("Sum of bd1 and bd9: " + result); } } /* Constructor with String: 123.45 Constructor with int: 100 Constructor with long: 123456789 Constructor with BigInteger: 99999 Constructor with String and MathContext: 123.46 Constructor with double (Not Recommended): 0.10000000000000000555 valueOf(double): 0.1 valueOf(long): 100 valueOf(long, int): 123.45 Sum of bd1 and bd9: 246.90 */
🌐
IIT Kanpur
iitk.ac.in › esc101 › 05Aug › tutorial › java › data › numberclasses.html
The Numbers Classes
BigDecimal extend the primitive data types in to allow for arbitrary-precision numbers (numbers that might not fit into any of the primitive data types). Note that whereas the other classes are in the java.lang package, BigDecimal and BigInteger are in the java.math package. ... NumberDemo, that creates two Float objects and one Double object and then uses compareTo and equals to compare them:.
🌐
IIT Bombay
cse.iitb.ac.in › ~cs296 › Java › SunJavaTutorial › java › data › numberclasses.html
The Numbers Classes
BigDecimal complement the primitive data types to allow for arbitrary-precision numbers (numbers that might not fit into any of the primitive data types).
🌐
Tutorjoes
tutorjoes.in › java_programming_materials › bigdecimal_valueof
BigDecimal.valueOf()
import java.math.BigDecimal; public class BigDecimalExamples { public static void main(String[] args) { BigDecimal valueA = BigDecimal.valueOf(30L); // Returns cached Object reference BigDecimal valueB = new BigDecimal(30L); // Does not return cached Object reference BigDecimal valueC = BigDecimal.valueOf(40L); // Does not return cached Object reference BigDecimal valueD = new BigDecimal(40L); // Does not return cached Object reference BigDecimal valueE = BigDecimal.valueOf(25.25); // Preferred way to convert a double into a BigDecimal BigDecimal valueF = new BigDecimal(25.25); // Return unpredictable result // Displaying the values System.out.println("Value A: " + valueA); System.out.println("Value B: " + valueB); System.out.println("Value C: " + valueC); System.out.println("Value D: " + valueD); System.out.println("Value E: " + valueE); System.out.println("Value F: " + valueF); } }
🌐
Medium
serdaralkancode.medium.com › why-use-bigdecimal-instead-of-double-java-179e51cd1cbc
Why use BigDecimal instead of Double? (Java) | by Serdar ALKAN | Medium
October 1, 2024 - BigDecimal can be slower than Double. Because BigDecimal stores very big number and uses more memory.
🌐
LinkedIn
linkedin.com › pulse › need-precision-why-you-should-use-javas-bigdecimal-janaka-wijerathne-vzoic
Need Precision? Why You Should Use Java’s BigDecimal and BigInteger Instead of Primitives
June 19, 2024 - We will also discuss how to compare instances of `BigDecimal` and `BigInteger`. The `double` type in Java, a 64-bit IEEE 754 floating-point, is commonly used for decimal values. However, it has inherent limitations due to how floating-point arithmetic works, leading to precision errors.