CIRCUITO
CARIOCA TI · DOCUMENTATION
♙
Converter

Number Base Converter

Convert arbitrarily large non-negative integers between binary, octal, decimal and hexadecimal without GMP and without floating-point precision loss.

BinaryOctalDecimalHexadecimalBase 2Base 8Base 10Base 16

Convert integers between number bases

Convert binary, octal, decimal and hexadecimal values. Spaces and underscores used only as visual separators are accepted.

Accepted conventional prefixes: 0b for binary, 0o for octal and 0x for hexadecimal when they match the selected source base.
RADIX

What is a number base?

A positional numeral system uses a radix, or base, to determine how many digit symbols are available and the value of each position. Decimal uses base 10. Binary uses base 2, octal uses base 8 and hexadecimal uses base 16. The written digits change, but the underlying integer value does not.

BASE 2

Binary: the natural representation of bits

Binary has only the digits 0 and 1. Each position is a power of two. For example, 11111111₂ equals 255₁₀. Binary is fundamental when studying bit masks, flags, registers, digital logic, permissions, addressing and low-level protocols.

BASE 8

Octal: compact groups of three bits

One octal digit represents exactly three binary bits because 8 = 2³. Octal remains especially visible in Unix-style permission notation: the read, write and execute bits form three-bit groups that map naturally to digits from 0 through 7.

BASE 10

Decimal: the everyday positional system

Decimal uses digits 0 through 9. Each position represents a power of ten. The value 255, for example, is 2×10² + 5×10¹ + 5×10⁰. Conversion does not change the quantity itself; it changes only the notation used to express it.

BASE 16

Hexadecimal: four bits per digit

Hexadecimal uses 0–9 followed by A–F for values ten through fifteen. Since 16 = 2⁴, every hexadecimal digit corresponds exactly to four binary bits. This makes hexadecimal much more compact than raw binary while preserving easy bit-level conversion.

0b · 0o · 0x

Prefixes identify notation, but conventions vary

The prefixes 0b and 0x are widely used to indicate binary and hexadecimal notation, while 0o is a clear modern notation for octal in several environments. Syntax is language-dependent: some C-derived contexts historically use a leading zero for octal, and shell arithmetic has its own base notation rules. This converter accepts 0b, 0o and 0x only when they match the selected source base.

NETWORKING

Why hexadecimal and binary matter in networking

Networking frequently exposes values at multiple representation levels. Subnet masks and prefix calculations are easier to understand in binary, while IPv6 addresses and protocol fields are commonly written in hexadecimal. Base conversion is therefore useful for learning how the same bits can be represented in different human-readable forms.

PROGRAMMING

Hexadecimal is common in debugging and low-level work

Memory addresses, masks, protocol fields, byte dumps, machine-level data and register values are frequently shown in hexadecimal because each hex digit maps cleanly to four bits. Octal remains relevant in Unix permissions, while binary is valuable when individual flags and bit positions matter.

PRECISION

Why this converter does not use PHP base_convert()

PHP documents that base_convert() may lose precision with large values because of properties related to its internal floating-point handling. This page instead performs integer conversion directly on strings using long division. That allows very large non-negative integers without requiring GMP or BCMath; the 10,000-character limit is an operational limit of this web tool, not a mathematical limit of the algorithm.

NOT ENCODING

Number-base conversion is different from Base64

Although the names look similar, converting the integer 255 from decimal to hexadecimal (FF) is not the same operation as Base64 encoding data. Base64 is a binary-to-text encoding designed to represent arbitrary byte sequences using a restricted text alphabet. A radix converter represents a numeric value in another positional numeral system.

ENDIANNESS

Base conversion does not change byte order

Endianness describes how the bytes of a multi-byte value are ordered in memory or a byte stream. It is a separate concept from radix. Converting 305419896₁₀ to 12345678₁₆ changes its textual representation; it does not by itself reorder the bytes as little-endian or big-endian.

FAQ

Number base converter frequently asked questions

What is a number base?+

A base, or radix, defines the digit symbols and positional weights used to represent a number. Binary is base 2, octal base 8, decimal base 10 and hexadecimal base 16.

How do I convert decimal to binary?+

Conceptually, repeated division by 2 produces remainders that form the binary representation. This calculator performs exact string-based conversion automatically.

How do I convert binary to decimal?+

Each binary position is a power of two. Add the powers corresponding to positions containing 1. For example, 1010₂ is 8 + 2 = 10₁₀.

Why does hexadecimal use A through F?+

Base 16 needs sixteen digit symbols. After 0 through 9, A, B, C, D, E and F represent decimal values 10 through 15.

Is the 0x prefix required?+

No. Hexadecimal input is accepted with or without 0x when hexadecimal is selected as the source base.

What do 0b, 0o and 0x mean?+

They are conventional textual prefixes commonly used to indicate binary, octal and hexadecimal notation. Exact syntax depends on the programming language or environment.

Why is octal used for Unix permissions?+

Read, write and execute form three permission bits, and one octal digit represents exactly three binary bits. This makes octal a compact notation for permission groups.

Why is hexadecimal common in computing?+

One hexadecimal digit maps exactly to four bits, making long binary values much shorter while keeping bit boundaries easy to inspect.

Is hexadecimal case-sensitive?+

Not for numeric value. A through F and a through f represent the same hexadecimal digits. This tool normalizes hexadecimal output to uppercase.

Can this converter handle very large integers?+

Yes. It uses string-based integer conversion rather than PHP base_convert(), avoiding its documented large-number precision caveat. The online input is limited to 10,000 characters for operational safety.

Does the tool require GMP or BCMath?+

No. The conversion algorithm operates directly on strings and standard integer operations involving only small intermediate values.

Does this tool convert negative numbers?+

Not currently. This version intentionally accepts non-negative integers only so sign handling is explicit rather than silently ignored.

Is hexadecimal conversion the same as Base64?+

No. Hexadecimal here is a positional representation of an integer. Base64 is a binary-to-text encoding for arbitrary byte data.

Does changing the number base change endianness?+

No. Radix changes textual numeric representation. Endianness concerns byte order in memory or data streams and is a separate concept.