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.
| 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:
| Decimal | Hex | Binary | Octal |
|---|---|---|---|
| 0 | 0 | 0000 | 0 |
| 1 | 1 | 0001 | 1 |
| 2 | 2 | 0010 | 2 |
| 3 | 3 | 0011 | 3 |
| 4 | 4 | 0100 | 4 |
| 5 | 5 | 0101 | 5 |
| 6 | 6 | 0110 | 6 |
| 7 | 7 | 0111 | 7 |
| 8 | 8 | 1000 | 10 |
| 9 | 9 | 1001 | 11 |
| 10 | A | 1010 | 12 |
| 11 | B | 1011 | 13 |
| 12 | C | 1100 | 14 |
| 13 | D | 1101 | 15 |
| 14 | E | 1110 | 16 |
| 15 | F | 1111 | 17 |
| 16 | 10 | 00010000 | 20 |
Number literal prefixes by language:
| Language | Hex | Binary | Octal | Notes |
|---|---|---|---|---|
| Python 3 | 0xFF | 0b1010 | 0o755 | A leading zero like 0755 is a syntax error. int("ff", 16) parses any base 2–36. |
| JavaScript | 0xFF | 0b1010 | 0o755 | Legacy 0755 octal is rejected in strict mode. Append n for BigInt, e.g. 0xFFn. |
| C / C++ | 0xFF | 0b1010 | 0755 | A leading zero means octal, so 010 is 8. Binary literals are standard since C++14 and C23. |
| Go | 0xFF | 0b1010 | 0o755 | 0755 is also octal. 0b and 0o were added in Go 1.13. |
| Java | 0xFF | 0b1010 | 0755 | Binary literals since Java 7. No 0o prefix. |
| Rust | 0xFF | 0b1010 | 0o755 | A 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):
| Bits | Signed min | Signed max | Unsigned max |
|---|---|---|---|
| 8 | -128 | 127 | 255 (0xFF) |
| 16 | -32,768 | 32,767 | 65,535 (0xFFFF) |
| 32 | -2,147,483,648 | 2,147,483,647 | 4,294,967,295 (0xFFFFFFFF) |
| 64 | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 | 18,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:
| Power | Decimal | Hex | Where you see it |
|---|---|---|---|
| 28 | 256 | 0x100 | Values in one byte |
| 210 | 1,024 | 0x400 | 1 KiB |
| 216 | 65,536 | 0x10000 | Values in 16 bits, TCP/UDP port numbers (0–65,535) |
| 224 | 16,777,216 | 0x1000000 | 24-bit RGB colours |
| 231 | 2,147,483,648 | 0x80000000 | One past the int32 maximum |
| 232 | 4,294,967,296 | 0x100000000 | IPv4 address space, uint32 range |
| 253 | 9,007,199,254,740,992 | 0x20000000000000 | JavaScript safe integer limit |
| 264 | 18,446,744,073,709,551,616 | 0x10000000000000000 | uint64 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.
Related Tools
All Converter Tools →JSON, YAML, CSV & XML Converter Online
Convert data between JSON, YAML, CSV and XML in any directio...
Color Converter
Convert colors between HEX, RGB, HSL, HSV, and CMYK formats...
Dockerfile Linter
Lint a Dockerfile for security and best-practice issues: unp...
Docker Compose Validator
Validate docker-compose.yml files: YAML syntax, service keys...
Kubernetes YAML Linter
Lint Kubernetes manifests for errors and best practices: mis...
Helm Values Tool
Compare and merge Helm values.yaml files the way Helm does,...