Skip to content
yutils
Example

Input

255

Output (all bases at once)

Binary (2):    11111111
Octal (8):     377
Decimal (10):  255
Hex (16):      ff
Base64 hint:   2-digit hex per byte

Note

Converts among decimal, hex, binary, octal, and any arbitrary base 2-36. Negatives are shown with a sign prefix (`-0xFF`). Floats are truncated to the integer part.

Usage / FAQ

When to use

  • Debug bit masks — what does 0xFF equal in decimal?
  • Compare hex vs decimal Unicode codepoints (U+5B57 = 23383)
  • Interpret chmod / permissions octal values (0o755, …)
  • Convert each channel of a hex color to decimal
  • Learn embedded systems and bitwise operations

FAQ

Q.Why up to base 36?
A.0-9 (10) + a-z (26) = 36 — the largest base expressible with Latin alphanumerics, and the limit of JavaScript's `Number.toString(36)`. Often used for short URL generation.
Q.How are negatives shown?
A.Sign-magnitude format — `-255` becomes `-0xFF` / `-11111111`. If you need the machine representation (two's complement), use an additional step.
Q.What about floats?
A.Only the integer part converts. `3.14` becomes `3`. For the IEEE 754 bit pattern of a float, combine the hex tool with a dedicated converter.
Fun facts
  • The core of base-10 — positional notation with a true zero — was developed in India between the 5th and 7th centuries, then adopted in the 8th by Persian and Arab mathematicians who carried it to Europe. Hence 'Hindu-Arabic numerals' — invented in India, transmitted via Arabia.

    Wikipedia — Hindu-Arabic numerals
  • The modern explanation of binary is Leibniz's 1703 'Explication de l'Arithmétique Binaire' — which he reportedly arrived at after studying the 64 hexagrams of the Chinese I Ching. The fact that the notation underlying every digital computer 250 years later took inspiration from a religious text is delightful.

    Wikipedia — Binary number history
  • Octal was popular in the PDP-11 era (1970s) because 12-, 24-, and 36-bit word systems mapped cleanly onto it, but it lost to 16 with the rise of the 8-bit byte. Today it survives mostly in Unix permission notation like `chmod 755` — 3 bits per digit lines up perfectly with rwx.

    Wikipedia — Octal