Developer tool

Base converter

Convert a number between binary, octal, decimal and hexadecimal.

Base converter Runs on your device
  • Runs in your browser — your text is never sent anywhere
  • No sign-up, no quotas, free to use as often as you like

How it works

Different corners of computing prefer different bases: binary for bit flags, hexadecimal for colours and memory addresses, octal for file permissions, decimal for humans. All of them describe the same number.

Reading the prefixes

A leading 0b, 0x or 0o marks binary, hexadecimal and octal in most languages. Paste them in if you like — they are stripped before conversion.

Whole numbers only

Conversion here covers integers. Fractional values in non-decimal bases are rare outside floating-point internals and are deliberately out of scope.

Supported bases

Binary (base 2, digits 0 and 1), octal (base 8, digits 0–7), decimal (base 10) and hexadecimal (base 16, digits 0–9 and A–F in either case). Choose the base your number is written in and the other three appear together.

Prefixes, signs and very large numbers

A 0b, 0o or 0x prefix that matches the chosen base is accepted, and so are spaces and underscores used to group digits (1111_0000). A leading minus sign is kept. Every digit is checked against the base, so a stray 2 in a binary number is reported instead of being silently dropped, and numbers of any length convert exactly — there is no 53-bit limit.

What it does not do

It converts whole numbers only: no fractions or floating point, and no two's-complement view of negative numbers. A negative number is shown with a minus sign in every base.

FAQ

Base converter — questions

Can it convert fractions?

No. It handles whole numbers, which covers almost every practical use.

Does it accept 0x and 0b prefixes?

Yes, they are recognised and stripped.

Is anything uploaded?

No, conversion happens in the page.