Course contentsShow
← JavaScript
Lesson 102 of 2,7234. Working with NumbersFree lesson

Scientific Notation (e-notation)

Use exponential notation like 1e6 or 2.5e-3 to represent very large or small numbers compactly.

Scientific Notation (e-notation)

You'll learn how to write extremely large or tiny numbers compactly using exponential notation.

When working with numbers like 5,000,000 or 0.00000025, typing all those zeros is tedious and error-prone. JavaScript lets you use scientific notation (also called e-notation) to express these values more clearly.

How E-Notation Works

The e (or E) in a number literal means "times 10 to the power of." The format is:

numberE+exponent  // positive exponent (large numbers)
numberE-exponent  // negative exponent (small numbers)

Large Numbers

Instead of 5000000, write:

let bigNumber = 5e6;  // 5 × 10⁶ = 5,000,000

The 6 after e means "move the decimal point 6 places to the right."

Small Numbers

Instead of 0.00000025, write:

let tinyNumber = 2.5e-7;  // 2.5 × 10⁻⁷ = 0.00000025

The -7 means "move the decimal point 7 places to the left."

More Examples

1e3      // 1,000
2.5e4    // 25,000
1e-3     // 0.001
3.14e-5  // 0.0000314

Think of It Like This

Imagine the e as shorthand for "shift the decimal." Positive numbers shift right (bigger), negative numbers shift left (smaller). It's the same notation scientists use for things like Avogadro's number (6.022e23) or electron mass (9.109e-31 kg).

Key Takeaway: Use e notation (like 1e6 or 2.5e-3) to write very large or very small numbers compactly—JavaScript interprets them as normal number values.