Converter Tools

Number Base Converter

Type a number in any field to see it in decimal, hex, binary, octal and any base from 2 to 36 at once. Use it to read memory dumps, bit masks and two's complement values, or to encode text as hex and binary bytes.

Private by design: anything you enter is processed in your browser only. It is never uploaded to or logged on our servers. Share links contain the number, text and display options.

0
Bit Length
0
Bytes
Grouped Binary (nibbles)
Two's Complement
Width Hex Binary

Negative values are shown as their two's complement bit pattern. "unsigned" means the value only fits as an unsigned integer of that width.

Text ⇄ Hex / Binary / Decimal Bytes

UTF-8 encoding. Edit either side to convert in that direction.

About number bases

A number base (or radix) is the count of distinct digits a positional numeral system uses. Everyday numbers are decimal (base 10), while computers store everything in binary (base 2). Hexadecimal (base 16) and octal (base 8) are compact ways to write binary: each hex digit is exactly four bits (a nibble) and each octal digit is three bits, which is why memory addresses, colour codes and byte dumps are written in hex and Unix file permissions in octal.

This converter updates every base as you type in any field. It uses JavaScript BigInt arithmetic, so there is no 53-bit precision limit — you can convert 128-bit hashes, 256-bit keys or numbers with hundreds of digits exactly. Prefixes such as 0x, 0b and 0o are recognised in any field, spaces and underscores are ignored, and negative numbers are supported. The custom base field covers every radix from 2 to 36 using the digits 0–9 followed by the letters A–Z.

Computers represent negative integers with two's complement: invert all bits of the positive value and add one. The table shows the bit pattern a value would have in 8, 16, 32 and 64-bit signed integers (int8 to int64), which is useful when reading memory dumps, debugging overflow bugs or working with bitwise operations.

The text section encodes any text, including emoji and non-Latin scripts, into its UTF-8 bytes and decodes hex, binary or decimal bytes back into text — handy as a quick hex encoder/decoder. Everything runs locally in your browser; nothing is uploaded.

Related tools: hex colour codes such as #FF8800 are three hex bytes, which the color converter turns into RGB and HSL. For binary data in text form, use the Base64 encoder. Octal file modes like 755 are explained by the chmod calculator, and binary subnet masks by the subnet calculator.

Reference Guide

The first 17 values in each base. One hex digit always equals four binary digits, and one octal digit three:

DecimalHexBinaryOctal
0000000
1100011
2200102
3300113
4401004
5501015
6601106
7701117
88100010
99100111
10A101012
11B101113
12C110014
13D110115
14E111016
15F111117
16100001000020

Number literal prefixes by language:

LanguageHexBinaryOctalNotes
Python 30xFF0b10100o755A leading zero like 0755 is a syntax error. int("ff", 16) parses any base 2–36.
JavaScript0xFF0b10100o755Legacy 0755 octal is rejected in strict mode. Append n for BigInt, e.g. 0xFFn.
C / C++0xFF0b10100755A leading zero means octal, so 010 is 8. Binary literals are standard since C++14 and C23.
Go0xFF0b10100o7550755 is also octal. 0b and 0o were added in Go 1.13.
Java0xFF0b10100755Binary literals since Java 7. No 0o prefix.
Rust0xFF0b10100o755A leading zero does not mean octal.

All of these languages accept _ as a digit separator (1_000_000) except C and C++, which use ' (C++14 and C23).

Integer ranges by width (signed values use two's complement):

BitsSigned minSigned maxUnsigned max
8-128127255 (0xFF)
16-32,76832,76765,535 (0xFFFF)
32-2,147,483,6482,147,483,6474,294,967,295 (0xFFFFFFFF)
64-9,223,372,036,854,775,8089,223,372,036,854,775,80718,446,744,073,709,551,615

JavaScript numbers are 64-bit floats, so integers are only exact up to Number.MAX_SAFE_INTEGER = 253 − 1 = 9,007,199,254,740,991. Use BigInt beyond that.

Useful powers of two:

PowerDecimalHexWhere you see it
282560x100Values in one byte
2101,0240x4001 KiB
21665,5360x10000Values in 16 bits, TCP/UDP port numbers (0–65,535)
22416,777,2160x100000024-bit RGB colours
2312,147,483,6480x80000000One past the int32 maximum
2324,294,967,2960x100000000IPv4 address space, uint32 range
2539,007,199,254,740,9920x20000000000000JavaScript safe integer limit
26418,446,744,073,709,551,6160x10000000000000000uint64 range

Example input

Decimal: 3735928559  (hex DEADBEEF)
Text:    Hello, world!

This sample loads automatically when you open the tool. Use Load Sample to bring it back.

Frequently Asked Questions

Multiply each bit by 2 raised to its position (counting from 0 on the right) and add the results. For example 1011 = 8 + 0 + 2 + 1 = 11. The converter does this instantly for any size number.

One hex digit maps to exactly four bits, so a byte is always two hex digits. That makes hex a compact, readable way to show memory addresses, colours, hashes and binary data.

Yes. It uses arbitrary-precision BigInt arithmetic, so numbers far beyond 64 bits convert without losing precision.