Hex Dec Bin Converter
Convert integers between decimal, hexadecimal, binary, and octal representations with arbitrary precision through BigInt arithmetic. Signed two's complement interpretation, configurable bit widths, and grouped digit formatting keep even large values readable across all four number bases.
This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.
Documentation
A hex, decimal, and binary converter shows one integer value's representation in decimal, hexadecimal, binary, and octal at the same time, so the four bases stay aligned instead of requiring separate lookups. BigInt arithmetic handles arbitrarily large numbers, so values beyond the standard 64-bit range convert without precision loss.
- Prefix notation identifies the input base automatically: 0x or 0X for hexadecimal (0xFF), 0b or 0B for binary (0b11111111), and 0o or 0O for octal (0o377). Plain digits with no prefix are read as decimal. An explicit base can also be set for a value with no prefix.
- Hexadecimal digits A through F are accepted in either case, and leading zeros are stripped from the output unless binary padding to a specific bit width applies. Spaces and underscores inside a value are ignored, so grouped notation such as 1111_0000 or FF 00 parses correctly.
- Output formatting options include grouping digits for readability (a space every four binary digits and every two hexadecimal digits), an uppercase or lowercase hexadecimal case (FF versus ff), and base prefixes (0x, 0b, 0o) prepended to each output.
- Signed mode interprets the value as a two's complement signed integer at a chosen bit width of 8, 16, 32, or 64, or the smallest standard width that fits the value when left on auto. In signed mode, 255 at an 8-bit width reads as -1 in decimal, since the full bit pattern 11111111 represents the largest negative offset from zero at that width.
- Negative decimal values are accepted directly. With signed mode off, the converter shows the absolute magnitude in each base and prefixes the decimal output with a minus sign rather than encoding the sign into the bit pattern.
The decimal value 50 converts to hexadecimal 32, octal 62, and binary 110010. Hexadecimal checks out as 3 x 16 + 2 = 50. Binary checks out as 32 + 16 + 2 = 50, the sum of the place values where a 1 appears in 110010.
Converting between number bases is a routine task across software development, hardware design, networking, and digital forensics. Having all four representations visible at once eliminates mental arithmetic and transcription errors.
- Firmware Development: Inspect register values returned by embedded hardware. A 32-bit hex register dump such as 0xDEADBEEF converts to binary to verify configuration bits are set correctly.
- Network Administration: Translate IPv4 subnet masks between decimal and binary notation. Converting 255 and 0 one octet at a time confirms each octet maps to the expected binary pattern of ones and zeros.
- Computer Science Education: Demonstrate how signed integers work in two's complement. At an 8-bit width, decimal values from -128 to 127 show their corresponding binary and hex encodings side by side.
- Assembly Language Programming: Convert immediate operand values between the bases different assembler syntaxes expect. An instruction using 0x1A in Intel syntax becomes 0b00011010 in a bitfield comment or 26 in a decimal annotation.
- Cryptography and Hashing: Verify hash digests or key material by converting hex strings to binary to count specific bit patterns or confirm key lengths. A 256-bit key should produce exactly 64 hex characters and 256 binary digits.
- Color Code Inspection: Break an RGB hex color like 0x3498DB into its red (0x34 = 52), green (0x98 = 152), and blue (0xDB = 219) decimal components by converting each two-character segment independently.
- Digital Forensics: Examine file magic bytes or memory offsets reported in hex by tools and convert them to decimal for byte-offset arithmetic or to binary for bitwise flag analysis.
- Game Development: Translate bitmask values used for collision layers, input flags, or tile attributes between hex shorthand and the binary layout that maps to each named flag.
Inputs, outputs, and what the Hex Dec Bin Converter computes
What the Hex Dec Bin Converter asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.
Inputs
- Number to Convert (text input)
- Input Base · default: Auto-detect
- Group digits for readability · default: on
- Uppercase hexadecimal output · default: on
- Show base prefixes (0x, 0b, 0o) · default: on
- Signed mode (two's complement) · default: off
- Bit Width (for signed mode and binary padding) · default: Auto
Controls
Convert · Reset
Example
The decimal value 50 converts to hexadecimal 32, octal 62, and binary 110010.