← Maths Tools

Number Base Converter

Convert numbers instantly between binary, octal, decimal, and hexadecimal.

Convert between binary, octal, decimal, hexadecimal, and any base from 2 to 36.

Custom Base

Convert to base result:
Binary Bit View
Decimal value
Bit length
Byte length
Advertisement
Ad space — 728×90

</> Embed this calculator

Free to embed on any website — no sign-up needed. Paste this snippet where you want the calculator to appear.

<div class="yootil-widget" data-tool="base-converter"></div> <script src="https://yootils.com/widgets/v7/widgets.js" integrity="sha384-+/J+UJUQkd8qBlJ2y9qW3wNk89iZUobwuVdo6dqpCvoanps684ZTa7cGCJ5L1AQc" crossorigin="anonymous" async></script>

Browse all embeddable widgets → How to install it →

How to Convert Between Number Bases

Binary (Base 2)

Binary uses only digits 0 and 1. Every computer processes information as binary since transistors can be in one of two states — on or off. The decimal number 10 is 1010 in binary (8 + 2).

Hexadecimal (Base 16)

Hex uses digits 0–9 and letters A–F. One hex digit represents exactly 4 binary bits (a nibble), so two hex digits = one byte. Widely used for memory addresses, colour codes (#FF5733), and raw data dumps. To convert hex colour codes to RGB or HSL, try the hex/RGB colour converter.

Octal (Base 8)

Octal uses digits 0–7. Each octal digit represents 3 binary bits. Still used in Unix file permissions (chmod 755) where each digit encodes read/write/execute permissions for owner, group, and others.

Custom Bases (2–36)

Any base from 2 to 36 is supported using digits 0–9 then A–Z. Base 36 is popular for compact identifiers (all alphanumeric). Base 60 (sexagesimal) was used by ancient Babylonians — hence 60 seconds in a minute.

Worked example

Decimal 255 in other bases: binary = 11111111 (8 bits all set — one full byte), octal = 377, hex = FF. The CSS colour #FF0000 is hex for (255, 0, 0) = pure red. Enter 255 in Base 10 and instantly see all representations — or enter FF in Base 16 to verify the conversion in reverse.

Related calculations

For colour codes specifically, the hex to RGB converter reads hex as three colour channels rather than one number. Both rest on the same base-16 arithmetic.

Frequently Asked Questions

How do I convert a number from decimal to binary?

Enter the decimal number and select Base 10 as the input — the result appears instantly in binary (Base 2), hex (Base 16), octal (Base 8), and more. Manually: divide by 2 repeatedly, recording remainders from bottom to top. For example, 10 in decimal becomes 1010 in binary (8 + 2).

What is hexadecimal used for?

Hexadecimal (Base 16) uses digits 0–9 and letters A–F. One hex digit represents exactly 4 binary bits, so two hex digits represent one byte. Hex is used for memory addresses, colour codes in web design (#FF5733), raw data dumps, and representing machine instructions compactly.

What is octal (Base 8) used for?

Octal uses digits 0–7, with each digit representing 3 binary bits. Its most common modern use is Unix/Linux file permissions — 'chmod 755' means the owner has read/write/execute (7), while group and others have read/execute (5).

Can I convert between any two bases?

Yes — the converter supports any base from 2 to 36, using digits 0–9 followed by letters A–Z for bases above 10. Converting between two non-decimal bases (e.g. hex to binary) uses decimal as an intermediate step. The result is instant for any supported base pair. To convert a decimal number to a fraction instead, try the decimal to fraction calculator.

See all Maths tools →

Evidence & Methodology

How This Page Is Grounded

Method

Parses an integer in the selected radix and repeatedly divides or expands positional place values to express it in another base.

Important limitation: The page states its supported integer size and does not imply that text encodings are numeric base conversions.

Primary Sources

  1. RFC 4648: Base encodings Internet Engineering Task Force

Quality Checks

Zero, negative values, invalid digits and round trips between binary, octal, decimal and hexadecimal are checked.

Built and maintained by
Published by
yootils
Source authority
Internet Engineering Task Force
Last reviewed

See how sources are selected and corrections are handled in our Editorial & Calculation Methodology, and which automated checks this page has to pass in How We Test.