Number Base Converter
Type a number in binary, octal, decimal, or hexadecimal and instantly read it in all four notations. Conversion uses arbitrary-precision integers (BigInt), so a 64-bit ID, a 256-bit hash, or any other enormous value converts exactly — unlike converters built on floating point, which silently corrupt integers above 2^53. Everything runs in your browser: nothing is sent to a server, and your input is saved locally so it survives a page reload. Each notation exposes different structure, which is why base conversion is everyday work in programming. One hexadecimal digit encodes exactly four bits, so hex is compact shorthand for binary — FF is 11111111, and a byte is always two hex digits — which is why memory addresses, color codes, and MAC addresses use it. Octal groups bits in threes and survives mainly in Unix file permissions (chmod 755). This tool converts plain non-negative integers: there is no fixed bit width, so it does not interpret two's-complement values (FF here means 255, not −1).
How to use
- Type or paste a number into the input — digits only, without a 0x or 0b prefix.
- Select the base the number is written in: binary (2), octal (8), decimal (10), or hexadecimal (16).
- Read the result in all four bases; the outputs update as you type.
- Copy any result with its Copy button.
- If an error appears, the input contains a digit that doesn't exist in the selected base (e.g. '8' in octal).
Frequently asked questions
- How large can the number be?
- Arbitrarily large. Conversion uses big integers (BigInt), so a 64-bit ID, a 256-bit hash, or something far larger converts exactly. Ordinary floating-point converters lose precision above 2^53 (about 9×10^15); this one never rounds.
- Are negative numbers or fractions supported?
- No — the tool converts non-negative whole numbers only. Negative values in real hardware depend on a declared bit width (in two's complement, FF is −1 as an 8-bit signed value but 255 unsigned), so without a width there is no single correct answer. Convert the magnitude here and apply the sign or width interpretation yourself.
- Do I need to type a 0x or 0b prefix?
- No — leave prefixes off. The input accepts only digits valid for the base you pick from the dropdown, so '0x1F' is rejected (the 'x' isn't a digit). Enter '1F' and select Hexadecimal instead.
- Why do programmers use hexadecimal and octal at all?
- Because they map cleanly onto bits. One hex digit is exactly 4 bits and two hex digits are one byte, which makes hex ideal for memory addresses, byte dumps, and #RRGGBB color codes. One octal digit is 3 bits, matching the rwx permission triplets in Unix (chmod 755).
- Why is my input marked invalid?
- It contains a character outside the selected base's digit set — for example '2' in binary or 'G' in hex. Hex digits may be upper- or lower-case and surrounding whitespace is ignored, but separators such as commas, spaces, or underscores inside the number are not accepted.
Guides on this topic
- Number Bases and Text Encodings: A Developer's Cheat Sheet A practical primer on binary, octal, decimal and hexadecimal, plus how text becomes bytes through UTF-8, Base64 and URL encoding — with the rules you actually need.
- Why numbers change when they pass through a program 0.1 plus 0.2 comes out as 0.30000000000000004, a long ID loses its last digits, and a total is a cent off. Almost all of it comes from one design decision: numbers are stored as binary fractions with a fixed budget of bits.
Related tools
Bitwise Calculator
AND, OR, XOR, NOT and bit shifts on two integers — shown in binary, hex, unsigned and signed decimal, with selectable 8, 16, 32 or 64-bit width.
ASCII Code Table
Browse and search the 256-row ASCII / extended-ASCII table — decimal, hex, octal, binary, and the named control characters.
Gray Code Converter
Convert between decimal, binary and reflected-binary Gray code, both directions, with an optional fixed bit width and a 0-7 reference table.
BCD Converter (Binary-Coded Decimal)
Convert decimal to and from 8421 binary-coded decimal — per-digit 4-bit nibbles, packed BCD hex bytes, and BCD validity checking.
Byte Size Converter (KB / KiB / MB / MiB / ...)
Convert between decimal (KB, MB, GB — SI base 1000) and binary (KiB, MiB, GiB — IEC base 1024) byte units, plus bits.
IPv4 Address Converter
Convert an IPv4 address between dotted-decimal, 32-bit integer, hex and binary — and see whether it's private, public, loopback and more.