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

βˆ‘ JS in Depth
XAH Β BUY NOW

JS in Depth

JS Obj Ref

DOM


JS in Depth

Basic Syntax

Value Types

Variable

String

Function

Property

Object and Inheritance

Array

Constructor/Class

Iterable 🌟

Misc