Home JavaScript Math Methods E JavaScript Math.E Constant Definition Math.E is a built-in constant that holds Euler's number, about 2.718281828459045. It is the base of natural logarithms. You read it as a property. You do not call it.
Read the value, use it in your math, and check the examples below for common patterns.
Syntax Read the constant. Start with this line.
Usage What it does Math.ERead the value of Euler's number.
Built into JavaScript. Read Math.E directly from the Math object — no parentheses and no import required.
Library declarations Parameters None. Math.E is a constant (a fixed value), not a function. Do not add parentheses.
Return Value Return Value Description Number About 2.718281828459045.
JavaScript Examples 1. Read the value 2. Math.E and exp() 3. Continuous growth Example 1 — Read the Value of Math.E No parentheses are needed. Just write Math.E.
console.log(Math.E); // 2.718281828459045
console.log(Math.E.toFixed(4)); // 2.7183
console.log(typeof Math.E); // number 2.718281828459045
2.7183
number How It Works Plain property. Math.E is a value, so there are no parentheses.Long decimal. The full number has 16 digits.Short form. toFixed(4) keeps 4 decimals and returns text.Type. typeof says it is a number.Example 2 — Math.E ** x and Math.exp(x) Raising Math.E to a power is the same as calling Math.exp().
console.log(Math.pow(Math.E, 2).toFixed(4)); // 7.3891
console.log(Math.exp(2).toFixed(4)); // 7.3891
console.log(Math.log(Math.E)); // 1 How It Works Power. Math.pow(Math.E, 2) is e × e.Shortcut. Math.exp(2) gives the same value, rounded here to 4 decimals.Undo it. Math.log() is the natural logarithm. It reverses the power.Log of e. Math.log(Math.E) is 1.Example 3 — Continuous Growth Money that grows all the time at 5% for 10 years follows principal × erate × years .
const principal = 1000;
const rate = 0.05;
const years = 10;
const amount = principal * Math.pow(Math.E, rate * years);
console.log(amount.toFixed(2)); // 1648.72 How It Works Inputs. Start with 1000 at 5% for 10 years.Exponent. rate * years is 0.5.Use e. Math.pow(Math.E, 0.5) is about 1.6487.Total. Multiply by the starting amount to get the final value.Compatibility
Browser & Runtime Support Math.E is part of the first JavaScript standard (ES1 ) and is Baseline Widely available in every browser and in Node.js.
✓ Baseline · ES1
Math.E A long-standing constant. It works in Chrome, Firefox, Safari, Edge, Internet Explorer and Node.js.
99% Modern browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support Math.E Excellent
Bottom line: Use Math.E anywhere. It works in all browsers.
Frequently Asked Questions What is Math.E in JavaScript? It is Euler's number, about 2.718281828459045. It is the base of natural logarithms.
Do I use parentheses with Math.E? No. Math.E is a number, not a function. Write Math.E, not Math.E().
How do I calculate e to the power of x? Use Math.exp(x). For example, Math.exp(2) is about 7.389.
How do I take a natural logarithm? Use Math.log(x). It uses Math.E as its base, so Math.log(Math.E) is 1.
Can I change the value of Math.E? No. It is read-only. Trying to change it does nothing, or throws an error in strict mode.
Which browsers support Math.E? All of them. It is part of the first JavaScript standard and works in every browser and in Node.js.
About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
9 people found this page helpful
Helpful Share Copy link Suggestion