Binary Converter

Free binary converter. Convert numbers between binary, octal, decimal, and hexadecimal with input validation and all four bases shown at once.

AI-ready Use this tool with AI

This tool has a free JSON API. Copy a prompt or skill below to use it with ChatGPT, Claude, or any AI agent โ€” no API key needed.

API docs
โ€”
Enter a value above.

How binary converter works

Numbers can be written in any base. Computers most often use base 2 (binary, digits 0 and 1), base 8 (octal, 0-7), base 10 (decimal, our everyday system), and base 16 (hexadecimal, 0-9 and a-f). Each base is just a different way of grouping the same value; conversion works by parsing the input in its source base and re-formatting it in the target base.

Enter a value, choose the base it is written in (from), and the base you want (to). The converter validates the digits against the source base โ€” for example it rejects "102" as binary because 2 is not a binary digit โ€” then parses and re-formats. It always shows the value in all four bases so you can see the whole picture at once.

Hexadecimal is common in programming for memory addresses and color codes, binary for bit-level work, and octal for Unix file permissions. This converter handles positive integers in any of the four bases and is a quick reference for translating between them.

Frequently asked questions

How do I convert decimal to binary?
Divide the number by 2 repeatedly and read the remainders from bottom to top. 255 in decimal is 11111111 in binary. This converter does it instantly and also shows the octal and hex equivalents.
What bases does it support?
Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Pick the source base the value is written in and the target base you want.
Why was my input rejected?
Each digit must be valid for the source base. "102" is not valid binary (2 is not a binary digit), and "gg" is not valid hex. The converter checks this before parsing and shows a clear error.
Does it support negative or fractional numbers?
This converter handles positive integers in the four supported bases. Fractional numbers and signed two's-complement binary are not included, since their representation depends on the chosen encoding.