Overview
Convert a number between binary, octal, decimal, and hexadecimal at once. Enter a value in any of the four bases and see all four representations immediately, with per-result copy buttons and a clear error when the input is not valid for the chosen base.
How It Works
Type a number into the input field and pick the base it is written in from the dropdown: binary, octal, decimal, or hexadecimal. Four result cards appear, one per target base, each with a copy button. Input is case-insensitive for hexadecimal, and an invalid digit for the selected base turns the input border red with a message. A quick-reference note reminds you which digits each base allows.
Step-by-Step Usage Guide
- Enter the number in the input field.
- Select which base the input is written in.
- Read the four result cards for binary, octal, decimal, and hexadecimal.
- Click Copy on the card you need.
Technical Specifications & Standards
Conversion goes through JavaScript's parseInt and the Number type's toString, which explains several behaviors worth knowing. Parsing stops at the first character that is not valid for the base, so 12abc in decimal quietly converts as 12 rather than raising an error; only inputs where no leading part is valid are flagged. Values are stored as IEEE-754 doubles, so results past 2^53 lose precision silently rather than wrapping, and there is no BigInt path. Fractional input is truncated to the integer part before conversion; there is no fixed-point or fractional digit support. Negative values are accepted and produce a minus sign followed by the magnitude in the target base, not two's-complement bits. Hexadecimal input may carry the 0x prefix, which parseInt accepts for base 16. Output is plain digits: hex is uppercase with no prefix, and binary has no separators, so group long results yourself when reading them aloud.
Targeted Use Cases
- Reading debug output that mixes hex memory addresses with decimal values.
- Preparing byte values for protocol documentation or data sheets.
- Checking bit patterns when working with flags, permissions, or hardware registers.
- Teaching positional number systems with all four bases visible at once.
Notes & Gotchas
- Verify that the entire input was consumed; trailing characters are ignored rather than rejected.
- Avoid inputs beyond 2^53 when exact integer values matter; use a BigInt-aware tool for those.
- Remember fractional values are truncated, so convert integer and fractional parts separately if needed.
- Use the red border and message as validation, but double-check silent truncation cases.
Frequently Asked Questions
Why did 12abc convert instead of failing?
Parsing stops at the first invalid character for the selected base and uses the leading valid portion, so 12abc in decimal becomes 12. Only inputs with no valid leading digits are reported as invalid.
Can it convert very large numbers exactly?
No. Values are held as doubles, so integers beyond 2^53 round before conversion. For cryptographic sizes or 64-bit values, use a tool that works on BigInt.
How are negative numbers handled?
The minus sign is preserved and the magnitude is converted, so minus fifteen in decimal shows as -1111 in binary. That is sign-magnitude display, not the two's-complement bit pattern a register would hold.
Does hexadecimal input need the 0x prefix?
No, the prefix is optional. Base 16 input accepts it for convenience, while the other bases do not.