π’
Free Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal. See bit-size fit and grouped binary output instantly.
Works offline once loaded
Input base:
Quick values
Common uses
- Convert Numbers for ProgrammingConvert between binary, octal, decimal, and hex while writing code β instant reference for any number.
- Convert Numbers for NetworkingConvert subnet masks, port numbers, and IP address octets between binary and decimal.
- Number Systems for Computer ScienceLearn and verify binary, octal, hex conversions β perfect for CS students and exam prep.
- Inspect Bit Patterns and FlagsConvert numbers to binary to inspect individual bits, bitmasks, and flag combinations.
- Decode Hex Dumps and Debug LogsDecode hexadecimal values from crash reports, memory dumps, and debug logs into readable decimal.
How It Works
Conversion runs entirely in your browser using JavaScript's built-in BigInt type β no library, no server. BigInt is used instead of the older parseInt/Number approach specifically to handle values larger than 2^53 without rounding errors.
- 1Input parsing with BigIntA custom parser strips optional prefixes (0x, 0b, 0o, #) and validates the character set for the chosen base, then passes the cleaned string to the BigInt() constructor, which handles arbitrarily large integers losslessly.
- 2Simultaneous base conversionOnce the BigInt value is known, the tool calls BigInt.prototype.toString() with each radix (2, 8, 10, 16, and a user-chosen base from 2β36) to produce all output representations in a single pass β no intermediate decimal step required.
- 3Binary grouping and bit-width checkBinary output is padded to a multiple of 4 and split into nibble groups for readability. The tool also checks whether the value fits inside 4-, 8-, 16-, or 32-bit signed/unsigned ranges using BigInt arithmetic, so overflow behavior is exact even for 32-bit boundaries.
- 4Shareable URL stateAfter each valid conversion the tool writes the input and source base to the URL fragment (#v=&from=) via history.replaceState, so the current conversion can be bookmarked or shared β the fragment is never sent to any server.
Related Tools
Hex Viewer
Inspect the raw bytes of any file in a classic offset / hex / ASCII dump, with magic-number file-type detection. Read locally; never uploaded.
Try itFiles stay local
Fraction Calculator
Add, subtract, multiply and divide fractions, or convert a decimal to its simplest fraction.
Try it
Binary to Text Converter
Convert text to binary (0s and 1s) and back. Supports UTF-8 encoding. See the byte and bit count for any text.
Try it