Skip to content
WebTricks

Number base converter

Convert numbers between binary, octal, decimal and hexadecimal. Type in any base, read all four.

BIN11111111
OCT377
DEC255
HEXff

About this base converter

Type a number in binary, octal, decimal or hexadecimal and read it instantly in all four bases. Input is validated against the base you pick, so an invalid digit (like a 2 in binary) is flagged rather than silently mis-parsed.

When you need it

Base conversion comes up constantly in development: reading hex colors and RGB values, working with bitmasks and flags in binary, decoding file permissions in octal, and inspecting bytes in memory or network dumps. Keeping the four side by side makes the relationships obvious.

FAQ

Why are colors and bytes written in hex?

Hexadecimal maps cleanly to bytes — two hex digits are exactly one byte (8 bits), so

What's the biggest number it handles?

It converts safe integers up to 2 to the power 53 minus 1 (JavaScript's safe integer limit). Larger values would lose precision, so they are rejected rather than shown wrong.