Number base converter

Convert integers between bases 2, 8, 10, and 16 within JS safe integer range.

{{ numberBase.message }}

Overview

Humans use base 10 for purely anatomical reasons: we have ten fingers. But base 10 is just one of infinitely many options for a positional numeral system. The Babylonians used base 60 — and their legacy is still with us: 60 seconds in a minute, 60 minutes in an hour, 360 degrees in a circle. The Maya independently developed a base-20 system, likely counting toes as well. The positional system with zero we use today arrived in Europe through Fibonacci's Liber Abaci in 1202, after being developed in India and transmitted by Arab mathematicians — hence the name Arabic numerals. The idea that there is nothing special about base 10 beyond biological evolution is a good starting point for understanding why computers adopted a completely different base.

In 1937, Claude Shannon published a master's thesis at MIT considered one of the most important in computing history: he proved that two-state electrical circuits (on/off) could perform any logical and arithmetic operation. Binary became the language of machines. ENIAC (1945), one of the first electronic computers, curiously used decimal arithmetic — the project's mathematicians were reluctant to abandon base 10. The transistorized computers of the following decades consolidated binary because the transistor is naturally binary: current flows or it does not. Hexadecimal emerged as an elegant shorthand: each hex digit represents exactly 4 bits (one nibble), so 8 bits = 2 hex digits. A byte ranges from 00 to FF, far more compact than 00000000 to 11111111. IBM standardized hex in the System/360 in 1964, and since then it has dominated machine code debugging, memory addresses, and process dumps.

Octal (base 8) was more popular in the era of 12- or 18-bit computers — the DEC PDP-8 used 12-bit words, and octal neatly grouped bits in sets of three. The Unix `chmod 755` command is octal's most visible survivor today: 7 = 111 in binary (read + write + execute), 5 = 101 (read + execute). Understanding that `chmod 755` is base 8, not base 10, instantly explains why digits 8 and 9 never appear in Unix permissions. In modern web development, hex dominates: CSS colors like #FF5733, SHA-256 hashes (64 hex digits = 256 bits), UUIDs, MAC addresses, and session cookies. This tool converts between the four bases most commonly used in programming, within JavaScript's safe integer range (`Number.MAX_SAFE_INTEGER` = 2^53 - 1).

Technical deep dive

Common questions summarized

  • What is this tool for?: It runs fully in your browser: useful to validate, format, or convert data in everyday development.
  • Are my inputs sent to a server?: Processing happens locally with JavaScript. We do not store what you paste into the text areas.
  • Can I use this for real production data?: Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.

Sample payload to try

  • See also the larger "Code Snippets" sample; paste this excerpt to try locally: Sample — 255 (decimal) = 11111111 (bin) = FF (hex)

Tool guide

  • What a numeric base is A way to write integers: decimal (0–9), binary (0–1), octal (0–7), hexadecimal (0–9 and A–F). The mathematical value is the same; only the representation changes.

  • What the tool does Converts integers between these bases within JavaScript’s safe integer range.

  • Why use it Low-level programming, colours (#RRGGBB), bit masks, study, and quick checks without a calculator.

Code Snippets

Code example
255 (decimal) = 11111111 (bin) = FF (hex)

Sample

255 (decimal) = 11111111 (bin) = FF (hex)

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.