JavaScript Number Methods

Beginner
⏱️ 6 min read
📚 Updated: Jul 2026
🎯 10 Tutorials
Number.prototype

What You’ll Learn

JavaScript Number methods help you convert and format numeric values for the UI, APIs, and debugging. This hub indexes 10 tutorials with examples and try-it labs.

01

toString

Any base

02

Radix

2–36

03

Hex / bin

Colors & bits

04

Display

UI text

05

Safe

Baseline

06

10 guides

Growing

Introduction

A JavaScript Number is an IEEE-754 floating-point value. Instance methods live on Number.prototype. Static methods like Number.isFinite(), Number.isInteger(), Number.isNaN(), Number.isSafeInteger(), Number.parseInt(), and Number.parseFloat() are called on Number itself.

Start with toString() to learn decimal strings and optional radix conversion for binary and hex.

👀 Number → String in One Call

The same method adapts to the base you need:

(255).toString() → "255" (255).toString(16) → "ff" (6).toString(2) → "110" (-10).toString(2) → "-1010"

Number Methods Index

Search by method name or browse by category. Each tutorial includes syntax, five try-it examples, and FAQs.

Convert to String

4 tutorials

Turn numbers into text for display, fixed decimals, significant digits, scientific notation, colors, and base conversion.

MethodDescriptionTutorial
toString()Return a string for a number in base 2–36 — default decimal, binary/hex via radix, keeps the minus sign for negatives.Open
toExponential()Format a number in exponential (scientific) notation — optional fractionDigits 0–100 for mantissa precision.Open
toFixed()Format a number with a fixed count of decimal places — rounds, pads zeros, returns a display string.Open
toPrecision()Format a number to a chosen count of significant digits — may use plain or exponential form.Open

Static Methods

6 tutorials

Call on Number itself (not on number instances) to inspect, validate, or parse values.

MethodDescriptionTutorial
isFinite()Static check: return true only for finite number values — no coercion, rejects Infinity, NaN, and non-numbers.Open
isInteger()Static check: return true only for integer number values — no coercion, rejects floats, Infinity, NaN, and non-numbers.Open
isNaN()Static check: return true only for the number value NaN — no coercion, safer than global isNaN().Open
isSafeInteger()Static check: return true only for integers in the MAX_SAFE_INTEGER / MIN_SAFE_INTEGER range — no coercion.Open
parseInt()Static parse: turn a string into an integer with optional radix 2–36 — same as global parseInt.Open
parseFloat()Static parse: turn a string into a floating-point number — keeps decimals, same as global parseFloat.Open

❓ Frequently Asked Questions

Number methods include instance formatters on Number.prototype (toString, toFixed, and so on) and static helpers on Number itself — for example Number.isFinite(), Number.isInteger(), Number.isNaN(), Number.isSafeInteger(), Number.parseInt(), and Number.parseFloat().
Start with toString() for text and base conversion, then formatting methods. For validation and parsing, learn Number.isFinite(), Number.isInteger(), Number.isNaN(), Number.isSafeInteger(), Number.parseInt(), and Number.parseFloat().
Conversion and formatting methods return a new string or number. They do not mutate the original primitive — numbers are immutable values.
A static method is called on Number itself, such as Number.parseFloat(s) or Number.isSafeInteger(x). It is not called on a number instance like (5).parseFloat().
Number uses floating-point and loses precision above Number.MAX_SAFE_INTEGER. BigInt handles arbitrary-size integers. Use BigInt for huge exact integer base conversions.
Open toString(), toExponential(), toFixed(), toPrecision(), isFinite(), isInteger(), isNaN(), isSafeInteger(), parseInt(), or parseFloat() from the index below for syntax, examples, five try-it labs each, and FAQs.

Start with toString()

Learn decimal strings, binary, hex, and base conversion.

toString() 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.

6 people found this page helpful