JavaScript Math.E Constant

Beginner
5 min read
Updated: Nov 2026
3 examples
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.

JavaScript
Math.E
UsageWhat 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
JavaScript
Math.E

Parameters

None. Math.E is a constant (a fixed value), not a function. Do not add parentheses.

Return Value

Return ValueDescription
NumberAbout 2.718281828459045.

JavaScript Examples

Example 1 — Read the Value of Math.E

No parentheses are needed. Just write Math.E.

JavaScript
console.log(Math.E); // 2.718281828459045
console.log(Math.E.toFixed(4)); // 2.7183
console.log(typeof Math.E); // number
Try It Yourself

How It Works

  1. Plain property. Math.E is a value, so there are no parentheses.
  2. Long decimal. The full number has 16 digits.
  3. Short form. toFixed(4) keeps 4 decimals and returns text.
  4. 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().

JavaScript
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
Try It Yourself

How It Works

  1. Power. Math.pow(Math.E, 2) is e × e.
  2. Shortcut. Math.exp(2) gives the same value, rounded here to 4 decimals.
  3. Undo it. Math.log() is the natural logarithm. It reverses the power.
  4. 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.

JavaScript
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
Try It Yourself

How It Works

  1. Inputs. Start with 1000 at 5% for 10 years.
  2. Exponent. rate * years is 0.5.
  3. Use e. Math.pow(Math.E, 0.5) is about 1.6487.
  4. Total. Multiply by the starting amount to get the final value.

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

It is Euler's number, about 2.718281828459045. It is the base of natural logarithms.
No. Math.E is a number, not a function. Write Math.E, not Math.E().
Use Math.exp(x). For example, Math.exp(2) is about 7.389.
Use Math.log(x). It uses Math.E as its base, so Math.log(Math.E) is 1.
No. It is read-only. Trying to change it does nothing, or throws an error in strict mode.
All of them. It is part of the first JavaScript standard and works in every browser and in Node.js.

Next: LN10

Learn about natural log of 10.

LN10 tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

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