JavaScript: Convert Decimal/Hexadecimal

By Xah Lee. Date: . Last updated: .

Decimal to Hexadecimal

(n).toString(16))

[see Number.prototype.toString]

Hexadecimal to Decimal

parseInt(hexadecimal_string, 16)

[see Number.parseInt]

JavaScript Number

BUY
Ξ£JS
JavaScript in Depth

JavaScript in Depth

Basic Syntax

Value Types

Variable

String

Property

Object and Inheritance

Array

Function

Constructor/Class

Iterable 🌟

Misc