/

Number Base Converter

Processed Client Side

Convert numbers between binary, octal, decimal, and hexadecimal with full BigInt precision.

Input
Presets
Conversions
Binary
0b1111 1111
Octal
0o377
Decimal
255
Hexadecimal
0xFF

Bookmark this tool now — skip the search next time you need it.

About Number Base Converter

This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.

Convert a number between binary, octal, decimal, and hexadecimal, and see all four representations at once. Pick the base your input is written in, type the number, and every other base updates immediately, with the conventional prefixes — 0b, 0o, 0x — and digit grouping that makes long values readable. Conversion is done with arbitrary-precision integers, so values far beyond the range where floating-point arithmetic starts silently rounding are still exact. That matters for the things developers actually convert: 64-bit flags, permission masks, colour values, and memory addresses. Prefixes and grouping separators in your input are ignored rather than rejected, so a value copied back out of the tool, or straight out of a debugger, can be pasted in as it stands.

Key features

  • Binary, octal, decimal, and hexadecimal shown together — change the input and all four update
  • Arbitrary-precision arithmetic using BigInt, so very large values stay exact instead of rounding
  • Conventional prefixes on the output: 0b for binary, 0o for octal, 0x for hexadecimal
  • Digit grouping — binary and hex in groups of four, decimal in thousands — so long numbers stay readable
  • Input base selector for binary, octal, decimal, and hex
  • Invalid digits are reported precisely, naming the character that is not valid in the chosen base
  • Preset values for common starting points — 255, 0xFF, and the byte and word boundaries, each preloaded with its own base
  • Input tolerant of 0x prefixes and grouping spaces, so a value can be pasted back in exactly as it was displayed
  • Each base shown on its own card, grouped for reading, with the prefixed form available to copy
  • Runs entirely in your browser with no size limit imposed by a server

How to use it

  1. Choose the base your number is currently written in.
  2. Type or paste the number.
  3. Read the binary, octal, decimal, and hexadecimal results side by side.
  4. Copy whichever representation you need.

Tips & common mistakes

  • One hex digit is exactly four binary digits, which is why hex is the shorthand for bit patterns — 0xFF is 11111111 and needs no arithmetic to see.
  • Octal survives mainly in UNIX file permissions: 0755 is rwxr-xr-x because each octal digit encodes exactly three permission bits.
  • Because this uses BigInt, values beyond 2^53 stay exact. Ordinary JavaScript number arithmetic starts losing integer precision above that point.
  • Colour work is base conversion in disguise: #FF8000 is three bytes, and reading them as 255, 128, 0 is what the RGB tools do for you.
  • An "invalid digit" error usually means a stray prefix or separator — strip the 0x, 0b, or spaces, or switch the input base to match what you actually pasted.
  • Negative numbers in binary are normally stored as two-complement in a fixed width, so a raw conversion here will not match what a debugger shows for a negative 32-bit int.
  • The displayed value is grouped for reading and the copied value carries its prefix instead. That is deliberate — grouped digits are easier to check by eye, and the prefixed form is what a compiler or a REPL will accept.
  • Leading zeros carry no value here, so 0755 and 755 in base 8 convert identically. In source code the leading zero is what marks a literal as octal, which is a difference worth keeping in mind when you paste a result back into a file.

Related tools

Browse all 3 Number tools

Frequently asked questions

10

Enter your number in any base field and all other representations update instantly. Supports binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16).

Yes — conversion uses JavaScript's BigInt type so there is no floating-point precision loss, even for 64-bit integers and larger values.

Binary output is grouped in nibbles (4 bits) and hex in bytes for readability. The value copied to your clipboard has no spaces.

Currently only non-negative integers are supported. Negative values and fractional numbers are not yet handled.

Enter the hex value (without the # prefix) in the hex field and the decimal equivalent appears instantly in the decimal field.

One hex digit maps to exactly four binary digits, so hex is a compact shorthand for bit patterns. 0xFF is 11111111 with no arithmetic required, which is why it dominates colour codes, memory addresses, and bit masks.

Mainly UNIX file permissions. In 0755, each octal digit encodes exactly three permission bits, which is what makes 755 a natural way to write rwxr-xr-x.

The input contains a character that does not exist in the base you selected, often a leftover 0x or 0b prefix or a separator. Strip the prefix, or change the input base to match what you actually pasted.

Split the six digits into three pairs and convert each pair from base 16 to base 10 — #FF8000 becomes 255, 128, 0. The HEX to RGB tool does all three at once and previews the colour.

Yes. Conversion uses arbitrary-precision BigInt arithmetic, so values above 2^53 stay exact instead of silently rounding the way ordinary JavaScript number arithmetic does.