← Back to DevKit

Base Converter

BASE CONVERTER · ENCODE & SECURITY

Convert between any base (2–36), integers and fractions alike — handy for memory addresses, color values and protocol fields.

Base Converter
From → To
Result

>_ USAGE GUIDE

Convert between any bases from 2 to 36, with both integers and fractions supported: specify the source base on input and the target bases update in real time. Handy whenever you read memory addresses in hex, decode permission bits and bitmasks in binary, or debug protocol fields that mix bases — no more juggling the system calculator's limited modes.

  1. Enter the value: type the digits without any prefix
  2. Set the source base: 2 for binary, 8 for octal, 16 for hex, up to 36
  3. Read every target: decimal, hex, binary and more update instantly as you type

Everyday numbers convert just as well — hex color values like #FF5733 or octal file permissions like 0755. It also suits quick sanity checks while reading low-level documentation: register values, bitmasks, and wire-format fields all arrive in whatever base the author chose, and translating them to decimal is often the fastest way to grasp their magnitude. Pure math runs locally in real time with no network requests.

>_ FAQ

Q1 · What does the 0x prefix mean?

0x marks the number that follows as hexadecimal: 0x1A equals 1×16 + 10 = decimal 26, since A stands for 10 in hex. Similarly 0b marks binary and 0o marks octal. When entering values here, just select the matching base — no prefix needed.

Q2 · How do binary fractions convert, and why is 0.1 unrepresentable?

The integer part expands by powers of the base; the fractional part is converted digit by digit by repeated multiplication. Note that many decimal fractions (0.1 is the famous example) are repeating decimals in binary — this is the root of floating-point error. The computer is not miscalculating; the decimal fraction simply cannot be expressed exactly in a finite number of binary digits. This tool gives a high-precision approximation.

Q3 · How are negative numbers converted?

This tool treats negatives as signed values, converting the magnitude and keeping the sign. Keep in mind that computers actually store negatives in two's complement: in 32 bits, -1 is 0xFFFFFFFF. To inspect the two's-complement form, convert the absolute value to binary, invert the bits, and add one.

Q4 · Why is hexadecimal so popular in programming?

One hex digit maps exactly to 4 binary bits, so two hex characters describe a full byte (FF = eight 1-bits). It is compact and bit-aligned at the same time — the best compromise between humans and bytes. Memory addresses, colors, protocol dumps, and hash outputs all use it for this reason.

Q5 · Why do digits turn into letters after base 10?

For bases above 10, the digit values 10–35 are written A–Z (A=10, Z=35) by universal convention, just as hex uses A–F. Base36 therefore expresses fairly large numbers using only letters and digits, which is why short-link slugs and compact order codes often use it.

Embed code

Paste the code below into your page to embed this tool as an iframe (nav and footer auto-hidden).

Heightpx
This tool runs entirely in your browser — input never leaves your device. Press Ctrl K to switch tools anytime.