Binary, octal, decimal and hexadecimal are different ways to write an integer, not different quantities. The digits must be interpreted in the correct base before conversion. A string such as 10 represents ten in decimal but two in binary, which is why the input-base selector is as important as the number field.
This guide uses ToolsOnDuty's Number Base Converter for two verified examples: decimal 255 and decimal 9007199254740993. We compared the second example with independent BigInt calculations, checked hexadecimal input and Copy, and tested invalid digits, negative values, fractions and exponent notation.
1. Decide whether you are converting a number or encoded data
Use this tool when your source represents one non-negative whole number. It produces equivalent binary, octal, decimal and hexadecimal representations. It is not a text encoder, file-to-hex viewer or conversion between Base64 and raw bytes. For example, converting decimal 65 to hexadecimal 41 does not establish the character encoding of a document containing the letter A.
Likewise, a file checksum written in hexadecimal is usually a fixed-length identifier whose leading zeros matter. Treating it as an integer and converting it can remove that formatting. Preserve the original digest for comparison. Before starting, identify the meaning of your source, its base and any destination requirements such as an exact field width, signed representation or byte order.
2. Convert decimal 255 into all four displayed bases
Choose Decimal (10) as Input base and enter 255 in Number. Conversion updates from the entered value; there is no separate Convert button. In our live test, the result cards showed binary 11111111, octal 377, decimal 255 and hexadecimal ff. All four are the same integer written with different digit systems.
You can check the binary result by adding its place values: 128 plus 64 plus 32 plus 16 plus 8 plus 4 plus 2 plus 1 equals 255. Hexadecimal ff means fifteen sixteens plus fifteen ones. These small checks are useful because they verify the representation rather than merely trusting that a page displayed four strings.
Decimal: 255
Binary: 11111111
Octal: 377
Hexadecimal: ff3. Pair hexadecimal digits with the correct input base
For a hexadecimal source, choose Hexadecimal (16) before reviewing the result. We entered 0xFF and verified the same four outputs as decimal 255. Uppercase source letters were accepted and the hexadecimal result was displayed in lowercase. Prefix handling does not replace the selector: do not assume typing a prefix automatically changes the selected base.
A valid digit depends on its base. Binary permits only zero and one, while hexadecimal permits zero through nine and a through f. In our binary test, 102 produced an explicit error identifying 2 as an invalid digit. When changing the selector, recheck that the number still represents the intended source before copying a temporarily valid but unintended conversion.
4. Verify an integer beyond the ordinary safe-number range
We next entered decimal 9007199254740993, which is above JavaScript's maximum safe integer for the ordinary Number type. The converter uses integer arithmetic rather than a floating-point conversion. It retained the exact decimal value and produced hexadecimal 20000000000001. Independent BigInt conversion matched all four displayed outputs, including the full binary and octal strings.
This matters when working with large identifiers or integer values copied as text. A different program may already have rounded the number before you paste it, and this tool cannot recover missing digits. Keep exact source values as strings until a suitable integer parser reads them. Avoid passing them through an ordinary floating-point value merely to remove spaces or prepare a conversion.
BigInt("9007199254740993").toString(16)
// "20000000000001"5. Respect whole-number and sign limitations
In Decimal mode, our entries -1, 1.5 and 1e3 were rejected. The current parser expects a non-negative integer written with the digits of the selected base. Scientific notation is not a shorthand for one thousand here. A letter that is invalid in decimal may be a legitimate hexadecimal digit, so always describe input rules together with the chosen base.
This is not a signed machine-integer or floating-point bit-pattern inspector. It does not choose an eight-bit or thirty-two-bit width, produce two's-complement encodings, or decode an IEEE floating-point layout. If a programming task needs those conventions, define them separately instead of treating a plain mathematical representation as a complete memory format.
6. Copy the value without losing its intended format
Each result card has its own Copy control. We verified that copying the hexadecimal result for 255 supplied exactly ff. The output is the representation itself, not a label plus value or a newly added 0x prefix. Add a prefix only if your destination expects it, and avoid including instructional punctuation in the field you paste into.
The converter normalizes a numeric value rather than preserving cosmetic source formatting. Leading zeros are not retained as fixed-width padding in these representations. If your destination needs eight binary digits or a particular number of hexadecimal characters, apply its documented width rules separately. Also check how your destination handles very large integers so that an exact copied value is not rounded on arrival.
7. Review context, privacy and practical size limits
Conversion runs inside the browser tab and does not require uploading a file. Exact integer arithmetic avoids the usual floating-point precision problem, but it is not a promise of unlimited input size or instant processing for arbitrarily long digit strings. Very large values still consume browser memory and produce long outputs. Start with a small known value when troubleshooting.
For a consequential technical result, verify the source base, a reversible conversion and any required formatting in the receiving system. An integer conversion does not validate a color specification, barcode allocation or business identifier. Keep those domain checks separate. The successful large-number example establishes the tested behavior for that input, not certification of every possible downstream workflow.
Try the related tools
Apply the steps from this guide directly in your browser.
Frequently asked questions
What is decimal 255 in binary and hexadecimal?
The verified outputs are binary 11111111 and hexadecimal ff. Octal is 377. These are equivalent representations of the same non-negative integer.
Can this converter handle values above JavaScript's safe integer range?
It uses integer arithmetic. Decimal 9007199254740993 matched independent BigInt results in all four bases during our test. Keep the source exact as text; digits already rounded elsewhere cannot be recovered.
Can I convert negative numbers or fractions here?
The current tool rejects negative signs and fractional input. It converts non-negative whole numbers, not signed-width bit patterns, two's-complement encodings or floating-point representations.
Does entering 0x automatically select hexadecimal?
Do not rely on a prefix to select the base. Set Hexadecimal (16) explicitly and check the intended input. Our 0xFF example was verified with hexadecimal already selected.
