The Wikipedia page on it is a good place to start.

To sum up:

  • float is represented in 32 bits, with 1 sign bit, 8 bits of exponent, and 23 bits of the significand (or what follows from a scientific-notation number: 2.33728*1012; 33728 is the significand).

  • double is represented in 64 bits, with 1 sign bit, 11 bits of exponent, and 52 bits of significand.

By default, Java uses double to represent its floating-point numerals (so a literal 3.14 is typed double). It's also the data type that will give you a much larger number range, so I would strongly encourage its use over float.

There may be certain libraries that actually force your usage of float, but in general - unless you can guarantee that your result will be small enough to fit in float's prescribed range, then it's best to opt with double.

If you require accuracy - for instance, you can't have a decimal value that is inaccurate (like 1/10 + 2/10), or you're doing anything with currency (for example, representing $10.33 in the system), then use a BigDecimal, which can support an arbitrary amount of precision and handle situations like that elegantly.

Answer from Makoto on Stack Overflow
🌐
Javatpoint
javatpoint.com › float-vs-double-java
Float Vs Double Java - Javatpoint
Float Vs Double Java with java tutorial, features, history, variables, object, programs, operators, oops concept, array, string, map, math, methods, examples etc.
Java
Java Tutorial or Learn Core Java Tutorial or Java Programming Tutorials for beginners and professionals with core concepts and examples covers the basics and fundamentals of java technology.
Python
Learn Python Tutorial for beginners and professional with various python topics such as loops, strings, lists, dictionary, tuples, date, time, files, functions, modules, methods, exceptions etc.
JavaScript
Learn JavaScript tutorial for beginners and professionals covers fundamentals, uses of javascript, purpose of javascript, javascript validation, javascript dom objects, java objects, control statements and more.
Spring Boot
Learn Spring Boot Tutorial with features, project, starter project wizard, cli, application, annotations, dm, properties, actuator, thymeleaf view, jpa, jdbc
🌐
Baeldung
baeldung.com › home › java › java numbers › float vs. double in java
Float vs. Double in Java | Baeldung
January 4, 2025 - A float is a 32-bit single-precision floating-point type, occupying four bytes of memory. This compact size makes it well-suited for memory-constrained environments like embedded systems and mobile devices.
Discussions

floating point - Float and double datatype in Java - Stack Overflow
The float data type is a single-precision 32-bit IEEE 754 floating point and the double data type is a double-precision 64-bit IEEE 754 floating point. What does it mean? And when should I use float More on stackoverflow.com
🌐 stackoverflow.com
When should I use double and when should I use float for Java?
On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge. If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options: Limiting your involvement with Reddit, or Temporarily refraining from using Reddit Cancelling your subscription of Reddit Premium as a way to voice your protest. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/learnprogramming
65
59
January 6, 2024
float vs. double – What's the Key Difference?"
New to programming and curious: what's the main difference between float and double? When should I use one over the other?… More on reddit.com
🌐 r/learnprogramming
12
16
November 2, 2024
COMPLETE BEGINNER: When and why would I use a Float over a Double?
In 2022, you're probably fine pretty much just ignoring Float. Generally, RAM isn't a concern... and any iOS or macOS development you're doing is going to be using a 64-bit processor, so... you're fine just using Double for everything, pretty much. If you look back long enough, you will find a time when there was no such thing as Double. There was only Float. I mean, the name "Double" is kind of weird isn't it? It doesn't actually tell you what the data type is. "Float" comes from "floating point number", meaning we can move the decimal point around to make this number represent something drastically larger or smaller. "Double" just means... double-precision float. It's just a float with twice as much precision available. Why would you use a float instead of a double in 2022? For the same reason you'd use Int32, Int16, or Int8 instead of Int (which is functionally just Int64 now). If you know you don't need the precision that Double offers, Float takes up half as much RAM. More on reddit.com
🌐 r/swift
49
44
June 17, 2022
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › Float-vs-Double-Whats-the-difference
Java double vs float: What's the difference?
Compare Java's floating-point types, ... ... The key difference between a float and double in Java is that a double can represent much larger numbers than a float....
Published: May 23, 2026
🌐
Scaler
scaler.com › home › topics › float vs double in java - difference you should know
Float Vs Double in Java - Difference You Should Know - Scaler Topics
March 27, 2024 - Double is a 64-bit floating-point number, which means that it can store up to 15 decimal digits accurately. Choose from our industry-leading programs designed for career success ... The float keyword in Java is a primitive data type, and its size limit is 4 byte or 32 bits (1 byte = 8 bits) ...
🌐
Java Code Geeks
javacodegeeks.com › home › core java
Float vs. Double in Java - Java Code Geeks
February 4, 2025 - In Java, handling floating-point numbers efficiently is crucial for numerical computations. Java provides two primary data types for representing decimal numbers: float and double. While both serve the same purpose, they differ in precision, storage size, and use cases.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › top differences tutorial › java float vs double
Java float vs Double | Top 7 Beneficial Comparisons To Learn
January 11, 2024 - A float is mainly used to save memory in large arrays of floating-point numbers. We must remember that data type, such as currency, should never be used for precise values. The double data type is usually the default choice for decimal values.
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
Find elsewhere
🌐
Educative
educative.io › blog › float-vs-double-in-java
Float vs. double in Java
Precision and range: A float offers roughly 7 decimal digits of precision with a max range of approximately ±3.4×10³⁸, while a double provides about 15–16 decimal digits with a range up to approximately ±1.7×10³⁰⁸. Default type in Java: The compiler treats floating-point literals ...
🌐
Blogger
javahungry.blogspot.com › 2019 › 11 › difference-between-float-and-double-in-java.html
7 Difference Between float and double Datatypes in Java | Java Hungry
Data loss is expected when double is converted to float. 5. Default datatype : float is not the default data type value of floating point literals. double is the default data type of floating point literals. 6. Wrapper class : Wrapper class for float is java.lang.Float.
🌐
Study.com
study.com › business courses › java programming tutorial & training
Java: Floating Point Numbers - Lesson | Study.com
October 3, 2018 - The double data type stores decimal values with 15-16 digits of precision. Remember that the default value is 0.0d, so this means that if you don't append f or d to the end of the decimal, the value will be stored as a double in Java.
🌐
Blogger
javarevisited.blogspot.com › 2016 › 05 › difference-between-float-and-double-in-java.html
Difference between float and double variable in Java? Example
July 26, 2023 - Though both float and double datatype are used to represent floating-point numbers in Java, a double data type is more precise than float. A double variable can provide precision up to 15 to 16 decimal points as compared to float precision of ...
🌐
Java67
java67.com › 2019 › 10 › deep-dive-into-float-and-double-datatypes-in-java.html
float and double data types in Java with Examples | Java67
Without wasting any more of your time, let's just dive into the float and double data types: 1) Both float and double data types are mainly provided for scientific and engineering calculations.
🌐
FavTutor
favtutor.com › blogs › java-float-vs-double
Java: Float vs Double | 4 Main Differences (& when to use?) | FavTutor
February 23, 2021 - This loss of bits from the end of the number is very pronounced while using float. The number of bits lost is much lesser while using double because of the large number of bits allocated for the exponent. Default: Double is the default data type used by Java for dealing with fractional numbers.
🌐
Great Assignment Help
us.greatassignmenthelp.com › home › get to know the significant differences between float vs. double
Get To Know The Significant Differences Between Float Vs. Double
September 27, 2025 - Here is the difference in uses of the Float and Double: Float: Java Float data types are employed in massive arrays of floating-point integers to preserve memory.
🌐
Hackr
hackr.io › home › articles › programming
Float vs Double Data Types: What's The Difference [Updated]
January 30, 2025 - A float is a single precision, 32-bit representation of a floating point number, while a double provides double precision, occupying 64 bits. C++ also introduces long double, offering even more precision, though its size and precision vary by system.
🌐
YouTube
youtube.com › appficial
Java Floating Point Numbers - float and double - Java Tutorial - Appficial - YouTube
double and float are primitive data types for declaring floating-point numbers. double is more most commonly used because float is not precise. Variables dec...
Published: September 27, 2017
Views: 1K
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › difference-between-float-and-double
Difference between Float and Double - GeeksforGeeks
July 23, 2025 - The key difference is their precision and storage size. A float is typically a 32-bit number with a precision of about 7 decimal digits, while a double is a 64-bit number with a precision of about 15 decimal digits.
🌐
Instanceofjava
instanceofjava.com › 2016 › 08 › difference-between-float-and-double-java.html
Difference between float and double java - InstanceOfJava
Default value of double is 0.0d. Floating points numbers also known as real numbers and in java there are two types of floating point one is float and another one is double.
🌐
Medium
sunilkumar9633.medium.com › float-and-double-in-java-16508824459f
Float and Double in Java | by sunil kumar | Medium
August 22, 2026 - The Float data type is a single-precision 32-bit IEEE 754 Floating point which is used to represent Floating point numbers in Java. The default value of Float is 0.0f. The Float is 32 bits of storage and has a range of 3 .4e–038 to 3.4e+038. The Float values are represented with 7 decimal digits.Variables of type Float are useful when you need a fractional component, but don’t require a large degree of precision. For example, Float can be useful when representing the currencies such as dollars and cents.