Exact Integer Base Converter

Exact Integer Base Converter

One value. Four representations. No rounding.

Use ASCII digits 0–9 and A–F (or a–f), as permitted by the selected base. A leading + or − and surrounding whitespace are accepted. No prefixes (0x, 0b), separators, internal spaces, fractions or exponents.

At most 4096 raw characters and a 1024-bit magnitude (absolute value below 2^1024). Errors never round or truncate.

Leading zeros do not change magnitude. Integer outputs remove them; fixed-width outputs pad to width. Negative zero becomes 0.

Grouping is visual only: binary groups of four and hexadecimal pairs. Copies contain no grouping spaces.

Results

Results

Enter an integer to begin.

How to use

Choose a mode and input base, enter an integer, then convert. Edits are recalculated immediately. Exact integer mode preserves mathematical value; fixed width compares interpretations of one bounded pattern.

Worked examples

Decimal 42 = binary 101010 = octal 52 = hexadecimal 2A. In binary, 101010 = 32 + 8 + 2. In hexadecimal, 2A = 2 × 16 + 10 = 42. Two binary nibbles 0010 1010 form 2A. At 8 bits, FF = 255 unsigned; 255 − 256 = −1 signed, with sign bit 1.

Method and limits

Exact integer arithmetic accumulates digits by n = n × base + digit. A numeral system changes representation, not magnitude. For a width w, a pattern with its top bit set represents unsigned value − 2^w when interpreted as two’s complement. No wrapping, saturation or truncation is applied.

Frequently asked questions

Why is a negative number different from a bit pattern?

−1 is a mathematical integer. Its two’s-complement pattern depends on width: FF at 8 bits, FFFF at 16 bits. A bare hexadecimal numeral has no implicit signed width.

Why are 0xFF and 1e3 rejected?

The base selector supplies the base. Only integer digits and an optional leading sign are accepted; enter FF in base 16 or 1000 in base 10.

Related uses

Use this tool for integer documentation and register inspection. Physical units, permission flags, network addresses and truth tables require their own tools; they are not inferred here.

Browser-only privacy

Parsing, arithmetic and formatting happen on your device. No accounts, uploads, backend, analytics, tracking or advertising code are included. Input and results are never sent by this tool or placed in URLs. Normal page requests may still be logged by the static hosting provider.

Draft storage is off by default. Only enabling Remember on this device saves input and settings in localStorage. Reload restores only opted-in drafts and recomputes results. Clear saved data removes this tool’s saved draft and disables remembering. Reset clears the current input and settings. If storage is blocked, conversion remains usable in memory.

Copy writes text only when you choose a copy action. The tool never reads your clipboard or asks for sensitive permissions. If writing fails, selectable text is shown. Language switching transfers the current draft in memory without putting it in a URL.