NHRepon
Home
Services
All ServicesWeb Application DevelopmentMobile Application DevelopmentDigital Marketing and SEO
ProjectsToolsProductsPostsAboutContactLogin
HomeServicesProjectsToolsProductsPostsAboutContact
  • Home
  • Projects
  • Posts
Home/Tools/Converters/Number Base Converter
All Tools

Number Base Converter

Convert a value between binary, octal, decimal and hexadecimal — or any base from 2 to 36 — with the same number shown in every base at once.

Letters a–z stand for the digits above nine, so base 16 uses a–f and base 36 uses a–z. A 0x, 0b or 0o prefix is accepted when it matches the base.

Decimal
255
Hexadecimal
ff
Binary
11111111
Bits needed
8
1 byte

The same number in every base

The value written in bases two, eight, ten, sixteen, thirty-six and the input base
BaseValueGrouped
21111111111111111
8377377
10 (input)255255
16ffff
367373

Bases, and why hexadecimal exists at all

A numeral system is just a choice of how many digits to count before carrying. Base 10 uses ten, because humans have ten fingers. Base 2 uses two, because a transistor has two states, so it is the language hardware actually speaks. Octal and hexadecimal are shorthand for binary: eight and sixteen are powers of two, so each octal digit stands for exactly three bits and each hexadecimal digit for exactly four. One byte — eight bits — is therefore always two hex digits and never a whole number of octal ones, which is why hex won and octal survives mainly in file permission masks.

That exactness is why hex appears wherever raw bytes have to be written down for people: colour codes, hash digests, memory addresses, escape sequences, network packet dumps. Converting 11111111 mentally is slow and error-prone; writing FF instead is neither. The same applies in reverse when reading a specification — a protocol field described as two bytes is most usefully read as four hex digits.

Bases above sixteen are mostly of interest in base 36, which uses the whole alphabet and is the highest base JavaScript can express with single alphanumeric characters. Short URLs and ticket identifiers often use it because the alphabet is case-insensitive, so a code read aloud is unambiguous. The conversion itself is the same operation in every case: repeatedly divide by the base and collect remainders, or the reverse when reading a value in.

What does a number base converter do?

A number base converter rewrites the same quantity using a different counting system. The value does not change — only the notation does. Decimal 255, hexadecimal FF and binary 11111111 are three ways of writing one number, and each is convenient in a different place: decimal for people, hexadecimal for bytes, binary when the individual bits matter.

A base is simply how many distinct digits you count with before carrying to the next place. Base ten has ten digits and was chosen because people have ten fingers. Base two has two, because a switch has two states, which is why hardware works in it. Base eight and base sixteen are shorthand for binary, since eight and sixteen are powers of two: every octal digit stands for exactly three bits, every hexadecimal digit for exactly four. Base thirty-six uses the whole alphabet and is the highest base that can be written with ordinary alphanumeric characters.

The conversion is the same operation in every case. To write a decimal number in another base, divide it repeatedly by that base and read the remainders backwards. To read a value in from another base, multiply each digit by the base raised to its position and add. This tool does that with arbitrary-precision integers, so a value copied out of a hash or a memory dump converts exactly rather than losing its last digits to rounding.

How to convert between number bases

  1. Type the value. Letters a to z stand for the digits above nine, so base 16 uses a to f and base 36 uses a to z.
  2. Choose the base your value is written in. Bases 2, 8, 10 and 16 are the common ones; anything from 2 to 36 works.
  3. Read the four tiles at the top for the decimal, hexadecimal and binary forms, plus how many bits the value needs.
  4. Check the table underneath, which shows the same number in every base up to 36 alongside the base you entered.
  5. Use the grouped column for binary and hex: bytes are far easier to read in groups of eight and two than in one long run.
  6. Copy whichever form you need. Nothing is submitted, so it is safe to convert a value that came out of a private system.

Number Base Converter limits and rules

Limits, caps and standards referenced by this tool
ItemLimit
Bases supportedEvery base from 2 to 36, including binary, octal, decimal and hexadecimal
Digits0–9 then a–z, so a base above ten uses letters for the digits above nine
Prefixes0x, 0b and 0o are stripped when they match the chosen base
Negative valuesA leading minus sign is carried through to every output
GroupingBinary is grouped into bytes and hex into byte pairs to make them readable
PrecisionArbitrary-precision integers, so no digit is lost on a large value
Not handledFractions, two's complement, IEEE 754 floating point and base-64 style alphabets

When to use it

  • Reading a hexadecimal colour, hash or memory address back into decimal.
  • Checking which bits are set in a permission mask or a configuration register.
  • Writing a short identifier in base 36 or base 32 so it is compact and case-insensitive.
  • Making sense of the binary in a protocol specification next to the hex the same field is described in.
  • Teaching or checking the arithmetic behind positional notation without hand-converting a dozen values.

Is it private?

Everything happens in this page. The conversion is integer arithmetic on numbers you type, with no request sent anywhere, no storage and no log — which is the point when the value came out of a private system.

Frequently asked questions

Because four binary digits fit exactly into one hexadecimal digit. A byte is eight bits, so it is always exactly two hex digits and never a fraction of one. That makes hex a compact, lossless shorthand for binary: FF is easier to read and to say than 11111111, and converting between the two is a matter of reading four bits at a time. Octal, at three bits per digit, does not divide a byte evenly, which is why it survives mainly in file-permission masks where three-bit groups do line up.

Thirty-six, with this tool and in most programming languages. The limit is not a mathematical one — you could use any base — but a notation one: bases up to thirty-six can be written with the ten digits and the twenty-six letters, so a value stays readable. Beyond that you need punctuation, which collides with every other use of those characters. Base 36 is popular for short identifiers because it is case-insensitive, so a code read aloud or transcribed by hand is unambiguous.

As an ordinary negative value, with the minus sign in front of the digits in every base. That is what this tool does, and it is the right answer for arithmetic. It is not, however, how a computer stores a negative integer internally: hardware uses two's complement, where the top bit carries the sign and the value is stored as the bitwise inverse plus one. Converting a two's complement representation into a signed value needs to know the width in bits, which is why that is left out here rather than guessed.

The tool says so and names the offending character. In base 2 only 0 and 1 are valid; in base 8 the digits stop at 7; in base 16 they stop at f. Typing 9 into a binary field is a common slip, and the error is clearer than silently reinterpreting the input. The check applies to every digit in the value, so a typo partway through a long string is caught rather than truncated.

Because a long run of ones and zeros is unreadable without them. The grouped column pads the value to a whole number of bytes and separates them with spaces, so 1111 becomes 00001111 and a sixteen-bit value reads as two clean bytes. The same is done for hexadecimal in pairs of digits, matching the byte-per-two-digits convention. Copy the ungrouped column when the value is going back into a program.

No practical one. The arithmetic is done with arbitrary-precision integers rather than the ordinary floating-point numbers, so a value of a hundred digits converts exactly — which matters for a hash or a long identifier where the last few digits are the ones that distinguish it. The only ceiling is how much you want to paste into the box.

Related tools

  • Roman Numeral Converter
  • Data Size Converter
  • Hash Generator
  • Color Converter
  • Unix Timestamp Converter

Written and maintained by Md. Nur Hossain Repon.

NHRepon


Md. Nur Hossain Repon expert in NextJS, React, React Native and Flutter. He is a full-stack web and mobile application developer with 5+ years of experience and a passion for building innovative and robust application. Also, he has a strong background in developing high-quality web and mobile applications using the latest technologies and frameworks.
Let's build something amazing together 🚀

Quick Links


  • About
  • Projects
  • Services
  • Contact
  • Posts
  • Products
  • Privacy Policy
  • Terms of Service
  • Tools
  • Smart Life Hubs

Newsletter


We respect your privacy. Unsubscribe anytime.

Connect


© 2026 NHRepon. All rights reserved.

Build v1.5.4+56.73c4a90