Number Base Converter
Binary, Octal, Decimal, Hex

Type in any field and the rest follow. Convert whole numbers between binary, octal, decimal, hex and any base from 2 to 36 with exact big numbers, negative values, a clickable two's complement bit view, and text to bytes. 100% client-side. Zero data stored.

The number 255 shown as 11111111 in binary, 377 in octal and FF in hexadecimal

Number Base Converter Tool

Number

2 to 36 (digits 0-9, then A-Z)

Try:

Bit View and Two's Complement

Click a bit to flip it. The leftmost bit is the most significant. A negative number is shown in two's complement.

Read as unsigned
0
Read as signed (two's complement)
0
Hex of the bit pattern
00000000

Text and Bytes (UTF-8)

Text is encoded as UTF-8, so an accented letter takes two bytes and an emoji takes four. Edit either box and the other follows.

Common Use Cases

Bit Flags and Masks

Read a permission or feature mask such as 0x1F as binary, then click bits to see which flag you turn on or off.

Embedded and Low-Level Code

Check register values, memory addresses and opcodes in hex, and see the 8, 16, 32 or 64 bit pattern behind them.

Negative Numbers

See why -1 is 0xFF in one byte, and how the same bits read as 255 unsigned or -1 signed.

Computer Science Homework

Check your base conversions by hand against an exact answer, in any base from 2 to 36.

Debugging Big IDs

Paste a 64-bit ID that JavaScript would round, and read it back exactly in decimal, hex and binary.

Text as Bytes

Turn a string into its UTF-8 bytes in hex, binary or decimal, or decode a byte dump back into readable text.

Number Base Reference

One Hex Digit Is Four Bits

Hex Binary Decimal Hex Binary Decimal
000000810008
100011910019
200102A101010
300113B101111
401004C110012
501015D110113
601106E111014
701117F111115

Integer Limits by Width

Bits Signed range Unsigned maximum
8-128 to 127255 (0xFF)
16-32,768 to 32,76765,535 (0xFFFF)
32-2,147,483,648 to 2,147,483,6474,294,967,295 (0xFFFFFFFF)
64-9,223,372,036,854,775,808 to 9,223,372,036,854,775,80718,446,744,073,709,551,615

JavaScript numbers are exact only up to 9,007,199,254,740,991 (2^53 - 1). This converter uses BigInt, so it stays exact above that.

0x 0b 0o prefixes

Most languages write hex as 0xFF, binary as 0b1111, and octal as 0o17. The matching prefix is accepted when you paste a value.

Two's complement

To negate a number, flip every bit and add one. In 8 bits, 42 is 00101010, so -42 is 11010110.

Base 36

Uses the digits 0-9 and the letters A-Z, so Z is 35 and 10 is 36. It makes compact short IDs.

Separators

Spaces, commas and underscores inside a number are ignored, so grouped values such as 1111 0000 or 1_000_000 paste cleanly.

This tool converts whole numbers only. It does not convert fractions such as 0.1, and it does not read floating-point bit layouts (IEEE 754). Bit views are fixed at 8, 16, 32 and 64 bits.

Frequently Asked Questions

Why We Built This Number Base Converter

Base conversion looks easy until the numbers get real. A 64-bit ID pasted into a JavaScript console loses its last digits, a negative value in hex prints as a string of Fs nobody can read, and a quick search lands on a tool that only knows binary and decimal. We wanted one page that does binary, octal, decimal, hex and every base to 36 together, with exact answers at any size.

Every field is editable and stays in sync, the bit view shows what a value really looks like at 8, 16, 32 and 64 bits, and clicking a bit flips it so you can build a mask by feel. Text converts to UTF-8 bytes and back. Everything runs in your browser - nothing you type is sent anywhere.

The Number Base Converter is part of RJL.io's collection of free developer tools. Encode data with the Base64 Encoder, turn a Unix time into a date with the Timestamp Converter, and pick colors by hex with the Color Palette Generator.

Is your site ready for Google and AI search?

The free SEO Analyzer checks any page in seconds - meta tags, structured data, AI crawler access - and tells you exactly how to fix each issue on your platform.