Number base converter

Binary, octal, decimal and hexadecimal.

FreeRuns in your browserNo signupUpdated 2026-10-29

Whole numbers of any size, positive or negative. Fractions are not converted. Negative values are shown with a minus sign, not two's complement.

Bits needed

16

Fits in 32 bits

Bytes

2

4 hex digits

Conversions

  • Binary · base 2

    1111 1111 0011 1010

  • Octal · base 8

    177 472

  • Decimal · base 10

    65,338

  • Hexadecimal · base 16

    FF 3A

  • Base 36 · base 36

    1 EEY

About this tool

How it works and how to read the result.

Need this done for you?

Web app & SaaS development

SaaS products and web apps, from first version to scale.

See the service

What it does

A hex to decimal converter, and the other way round, is what you reach for when reading colour codes, memory addresses, file permissions, Unicode code points or hashed IDs. Type a number in any base from 2 to 36 and the binary, octal, decimal and hexadecimal forms appear at once, along with one extra base of your choosing. Values can be as large as you like and negative numbers are supported. Digit grouping, uppercase letters and 0x-style prefixes are options, so the output can be pasted into code, a spreadsheet or a document without editing.

How to use it

  1. Type the number. Prefixes such as 0x, 0b and 0o are accepted, and spaces, commas and underscores are ignored.
  2. Set the input base. It defaults to 16 for hexadecimal.
  3. Pick an extra output base if you need something other than the four common ones.
  4. Toggle grouping, uppercase and prefixes to suit where the value is going, then copy the line you need.

How to read the result

The default input FF3A in base 16 converts to 65,338 in decimal, 1111 1111 0011 1010 in binary and 177 472 in octal. The binary is grouped in fours because each group of four bits is exactly one hex digit: 1111 is F, 0011 is 3, 1010 is A. The "Bits needed" stat reads 16, and the hint says the value fits in 32 bits, so it is safe in any integer type.

Hex digits are grouped in pairs because each pair is one byte; the "Bytes" stat of 2 reflects that. Decimal output is grouped in thousands with commas for readability, which you can switch off when pasting into code.

If the input contains a digit that does not exist in the chosen base, such as 9 in binary or G in hex, a red message names the character rather than guessing. For a colour such as #1E90FF, convert each pair separately to get the red, green and blue values of 30, 144 and 255.

Low-level details like these come up in web app development more often than people expect. For colours specifically, the color converter handles hex, RGB and HSL together.

Questions

Frequently asked.

How do I convert hex to decimal by hand?

Work from the right. Each hex digit is worth 16 times the one to its right, and the letters A to F stand for 10 to 15. For FF3A: A is 10, 3 times 16 is 48, F times 256 is 3,840 and F times 4,096 is 61,440. Add them up and you get 65,338. The converter does this for numbers of any length.

Why does the result show a minus sign instead of two's complement?

Two's complement depends on a fixed width such as 8, 32 or 64 bits, and the converter does not assume one. It treats the input as a plain whole number and keeps the sign separate. If you need the two's complement form, add 2 to the power of the width to the negative value and convert that.

What is the largest number it can handle?

There is no practical limit, because the converter uses arbitrary-precision integers rather than floating point. A 100-digit decimal number converts exactly. The "Bits needed" stat tells you whether a value fits in 32 bits, in a standard JavaScript number, which is safe up to 53 bits, or needs a 64-bit type or BigInt.

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India · Working with clients worldwide

We reply within a working day. No spam, ever.