Skip to content

Binary & Hex Converter

Convert text and numbers between binary, hexadecimal, decimal, and octal formats for programming and data analysis.

0 characters 0 words

Related Tools

Character Counter Morse Code Translator Number to Words Converter Base64 Encoder & Decoder URL Encoder & Decoder

How to Use

  1. Enter Your Value — Type or paste a number in binary, octal, decimal, or hexadecimal format, or enter text to see its binary or hex representation.
  2. Choose a Mode and Input Base — Pick Number, Text to binary/hex, or binary/hex to Text mode. For numbers and bytes, choose the input base or leave it on Auto-detect.
  3. View All Representations — Click Convert (or press Ctrl+Enter) to see the value expressed in all four bases at once, then use Copy next to the one you need.

About the Binary & Hex Converter

The Binary & Hex Converter has three modes. Number converts a whole number between binary, octal, decimal and hexadecimal. Text → binary / hex bytes shows the UTF-8 bytes of any text in all four bases. Binary / hex bytes → text decodes a list of bytes back into readable text. Programmers use it to check bit masks, color values and byte dumps, students to practice base conversion, and anyone curious to see how many bytes an accented letter or emoji really takes.

How each mode works

Worked examples

InputModeResult
255NumberBinary 11111111, hex FF, octal 377, 8 bits
0xDEADBEEFNumberDecimal 3735928559, 32 bits
-42NumberBinary -101010, hex -2A, octal -52
HiText01001000 01101001 / hex 48 69
éText11000011 10101001 / hex C3 A9
😀TextHex F0 9F 98 80 (4 bytes)
48 69 or 01001000 01101001BytesHi

Edge cases to watch

When to use it

Hexadecimal is the usual shorthand for binary because each hex digit stands for exactly four bits, so a byte is always two hex digits. That is why CSS colors (#FF5733 is red 255, green 87, blue 51), Unicode code points (U+00E9), MAC addresses and memory dumps are written in hex. Text mode helps with encoding bugs: if é shows up as é, its two UTF-8 bytes C3 A9 were read as two separate Latin-1 characters. The Binary, Decimal, and Hexadecimal guide shows how to convert by hand, and the Base64 Encoder & Decoder covers the other common way of writing bytes as text.

All conversions run in your browser; nothing you enter is uploaded.

Frequently Asked Questions

What number bases does the converter support?

The tool supports four bases: binary (base-2), octal (base-8), decimal (base-10), and hexadecimal (base-16). You can convert in any direction between these four systems.

Can I convert text strings to binary or hexadecimal?

Yes. When you enter a text string, the converter encodes each character using its UTF-8 byte values and displays the binary and hexadecimal representations. This is useful for understanding how computers store text internally. The Binary / hex bytes to text mode reverses the process and decodes space-separated bytes back into readable text.

What is hexadecimal used for in programming?

Hexadecimal is widely used in programming for color codes (e.g., #FF5733), memory addresses, MAC addresses, and byte-level data inspection. Each hex digit represents exactly four binary bits, making it a compact way to express binary data.

How do I know if my input is valid for the selected base?

The tool validates your input against the base chosen in the From menu (or the base it auto-detects). Binary accepts only 0 and 1, octal accepts 0-7, decimal accepts 0-9, and hexadecimal accepts 0-9 and A-F. Prefixes such as 0b, 0o and 0x are recognised, spaces and underscores used for digit grouping are ignored, and an invalid character triggers an error message naming the problem.

Why is binary important in computing?

Computers operate using transistors that have two states: on and off. Binary (base-2) maps directly to this physical reality, with 1 representing on and 0 representing off. Every piece of data — text, images, audio — is ultimately stored and processed as binary.

Does the converter handle negative numbers or floating-point values?

Whole numbers of any size are converted exactly, including very large values beyond the usual 2^53 JavaScript limit. Negative numbers are shown with a minus sign (for example -1010 in binary). Two's-complement representation and IEEE 754 floating-point values are not supported.