🔢 Binary & Hex Converter

Convert between decimal, binary, hex, and octal. Includes Unicode inspector, IP address converter, IEEE 754 float visualizer, bit-width selector, and signed/unsigned bitwise operations.

Enter a Number
Input Value
Quick Presets
ASCII
Unicode / ASCII Lookup
🔢

Enter Details

Enter a number in any base to see all conversions

Guide

About the Binary & Hex Converter

Last updated: July 2026 · Reviewed by the NeftCal editorial team

This free binary hex converter is an all-in-one number base converter that instantly translates between decimal, binary, hexadecimal, and octal, while also covering four related developer tasks in one place: a Unicode/ASCII code lookup with UTF-8 and UTF-16 byte encoding, an IPv4/IPv6 address to binary tool with subnet mask breakdown, an IEEE 754 floating-point visualizer for both 32-bit and 64-bit precision, and signed/unsigned bitwise operations (AND, OR, XOR, NOT, shifts) across 8, 16, 32, or 64-bit widths. Whether you need a quick decimal to binary converter for a homework problem, a hex to binary tool for debugging memory addresses, or an IEEE 754 visualizer to understand why 0.1 + 0.2 doesn't equal 0.3 exactly, this single tool replaces several separate developer utilities.

What This Binary & Hex Converter Calculates

The Number Converter tab converts any value you type into decimal, binary, hexadecimal, or octal instantly, alongside a visual bit display and quick-preset buttons for common values like 255, 1024, and 65535. It also includes bitwise operators (AND, OR, XOR, NOT, left/right shift) with a signed/unsigned toggle, and a Unicode/ASCII lookup that shows a character's code point, UTF-8 bytes, and UTF-16 units. The IP Address tab breaks an IPv4 or IPv6 address into its per-octet or per-hextet decimal, hex, and binary form, and detects subnet mask patterns. The IEEE 754 Float tab visualizes the sign bit, exponent, and mantissa of any decimal number in both single (32-bit) and double (64-bit) precision.

Who Should Use This Calculator

This tool is built for software developers debugging bit-level flags or memory values, computer science students learning number systems and floating-point representation, network engineers calculating subnet masks and IP ranges, and anyone curious why 0.1 + 0.2 gives 0.30000000000000004 in nearly every programming language. It also serves students and hobbyists exploring Unicode encoding for non-English text and emoji.

Why Number Base Conversion Matters

Computers store everything in binary, but binary is unwieldy for humans to read, so hexadecimal (compact, 4 bits per digit) and decimal (familiar) serve as human-friendly shorthand. Understanding how these bases relate is foundational to reading memory dumps, color codes, IP addresses, and register values — and IEEE 754 float representation explains one of the most common sources of confusion in programming: why decimal fractions don't always add up exactly in floating-point arithmetic.

Real-World Applications

Software developers use hex to read memory addresses, debug bit flags, and work with color codes (#RRGGBB). Network engineers convert IP addresses to binary to calculate subnet masks and valid host ranges. Embedded systems programmers manipulate register values and bitwise flags directly. Text-processing applications rely on Unicode code points and UTF-8/UTF-16 encoding to correctly handle international text and emoji. Debugging floating-point precision bugs requires inspecting the exact IEEE 754 bit pattern behind a number.

Tips for Accurate Results

  • Remember that hex input accepts an optional "0x" prefix — both "CA" and "0xCA" work identically.
  • When comparing bitwise results, check whether you're viewing signed or unsigned interpretation — the same bits mean different decimal values in each mode.
  • For IPv6, addresses can be abbreviated with "::" to skip runs of zero groups — this tool expands them automatically.
  • When inspecting floating-point precision issues, compare the exact stored value shown for float32 against the decimal you entered.
  • For Unicode lookups, remember that characters outside basic ASCII (0–127) require multiple UTF-8 bytes — this is normal, not an error.
Formula

The Number Base & Encoding Formulas, Explained

How this tool converts between bases, addresses, and floating-point representations

Decimal → Binary
Repeatedly divide by 2, recording remainders; read remainders bottom to top

Binary → Hexadecimal
Group binary digits into 4-bit nibbles (right to left); convert each nibble to one hex digit

Bitwise Operations
AND, OR, XOR, NOT, and shifts applied bit by bit; negative signed values use two's complement (flip all bits, add 1)

IEEE 754 Floating Point
Value = (−1)^sign × 1.mantissa × 2^(exponent − bias); sign bit + biased exponent + mantissa fraction bits

Where:
Nibble = a group of 4 binary bits, equal to exactly one hex digit.
Bias = 127 for 32-bit single precision, 1023 for 64-bit double precision.
Two's complement = the standard method for representing signed (negative) integers in binary.
🔡

Four Number Systems

Base-2 (binary), base-8 (octal), base-10 (decimal), and base-16 (hex) all represent the same quantities, just grouped differently.

🌐

IPv4 vs IPv6 Structure

IPv4 is 32 bits as four 8-bit octets; IPv6 is 128 bits as eight 16-bit hextets written in hex for compactness.

📐

Float Precision Trade-off

32-bit float gives roughly 7 decimal digits of precision; 64-bit double gives roughly 15–17, at the cost of double the storage.

⚙️ Why This Formula Works

Every positional number system represents a value as a sum of digit × (base^position). Converting between bases just re-expresses the same underlying quantity in a different base — dividing by 2 repeatedly extracts binary digits one at a time, while grouping bits into 4s works because 16 = 2⁴, making each hex digit exactly equivalent to one nibble.

🎯 When to Use Each Tool

  • Number Converter: general base conversion, bitwise operations, and Unicode/ASCII lookups
  • IP Address: subnet mask calculations and network address inspection
  • IEEE 754 Float: debugging floating-point precision or understanding how decimals are stored

📋 Assumptions

  • Number Converter treats values as non-negative integers unless bitwise signed mode is toggled on
  • IP Address parsing assumes standard IPv4 dotted-decimal or IPv6 colon-hexadecimal notation
  • IEEE 754 visualization follows the standard 32-bit and 64-bit formats used by virtually all modern processors

⚠️ Limitations of the Formula

  • Bitwise operations in JavaScript operate on 32-bit signed integers internally, which can affect very large operand behavior
  • Not all decimal fractions have an exact binary representation, causing small IEEE 754 rounding errors
  • IPv6 zone identifiers and some non-standard address notations are not parsed by this tool
Walkthrough

Step-by-Step: How to Use the Binary & Hex Converter

From choosing a tool tab to exporting your result

Choose a tool tab

Pick Number Converter, IP Address, or IEEE 754 Float depending on what you need to convert or inspect.

Enter a value

Type a decimal, binary, hex, or octal number, an IP address, or a decimal float value into the matching field.

Read the instant conversion

All other bases, the bit visualization, and the IP or float breakdown update instantly as you type.

Adjust bit width or signed mode

For the Number Converter, switch between 8, 16, 32, and 64-bit views and toggle signed/unsigned interpretation of bitwise results.

Inspect Unicode or bitwise details

Use the Unicode/ASCII lookup for character encodings, or review the AND/OR/XOR/NOT/shift results for two operands.

Copy or export the result

Click any result box to copy its value, or use Export Result to download a text summary of the conversion.

Example

Worked Example

Converting decimal 202 to binary, hex, and octal

Scenario

A developer needs to express the decimal value 202 in binary, hexadecimal, and octal for a low-level debugging task.

Decimal202
Binary11001010
HexadecimalCA
Step 1 — Divide 202 by 2 repeatedly: 202÷2=101 r0, 101÷2=50 r1, 50÷2=25 r0, 25÷2=12 r1, 12÷2=6 r0, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1.
Step 2 — Read remainders bottom to top: 11001010 — this is 202 in binary.
Step 3 — Group into 4-bit nibbles: 1100 1010.
Step 4 — Convert each nibble to hex: 1100 = C, 1010 = A → hex CA.
Step 5 — Group into 3-bit sets for octal: 011 001 010 → octal 312.
Step 6 — Verify: 0xCA = 12×16 + 10 = 202 ✓; octal 312 = 3×64 + 1×8 + 2 = 202 ✓.
Binary
11001010
Hexadecimal
0xCA
Octal
0o312

Explanation: All three representations — 11001010, CA, and 312 — describe the exact same quantity (202), just grouped differently. Hex is favored in programming because each digit maps cleanly to a 4-bit nibble, making it far more compact and readable than raw binary while still being trivial to convert back.

Interpretation

Understanding Your Conversion Result

What each output actually represents

OutputWhat It MeansExample
BinaryThe value expressed as base-2 digits (0s and 1s), matching how computers store data202 → 11001010
HexadecimalA compact base-16 shorthand where each digit represents exactly 4 binary bits202 → 0xCA
Signed bitwise resultThe two's complement interpretation, where the top bit indicates a negative value~5 (32-bit) = −6 signed, 4294967290 unsigned
IEEE 754 fieldsSign, exponent, and mantissa bits that together encode a decimal value in binary1.0 → sign 0, exponent 01111111, mantissa all zeros
Subnet mask noteThe CIDR prefix length implied by a mask made of consecutive 1-bits then 0-bits255.255.255.0 → /24

Reading signed vs unsigned: the same raw bit pattern can represent two different decimal numbers depending on interpretation — always confirm which mode (signed or unsigned) is active before comparing bitwise results.

Typical ranges: an 8-bit unsigned value ranges 0–255, 16-bit spans 0–65,535, 32-bit spans roughly 0–4.3 billion, and 64-bit spans up to about 1.8×10¹⁹ — always match the bit width to your actual data type.

Manual verification: to check a hex-to-decimal conversion by hand, multiply each hex digit by 16 raised to its position power and sum the results — e.g. 0xCA = 12×16¹ + 10×16⁰ = 192+10 = 202.

Use Cases

Practical Use Cases for the Binary & Hex Converter

Where number base conversion and bit-level tools are genuinely useful

🎓

Computer science coursework

Practice number systems, bitwise logic, and floating-point representation for CS classes.

💻

Software development & debugging

Read memory addresses, hex color codes, and debug bit-level flags in application code.

🌐

Networking & subnetting

Calculate subnet masks, valid host ranges, and inspect IPv4/IPv6 address structure.

🔧

Embedded & low-level systems

Work with register values, hardware flags, and bit masks in firmware programming.

🔐

Cryptography & cybersecurity

Inspect binary/hex data structures relevant to hashing, encoding, and encryption routines.

🈳

Text encoding & internationalization

Look up Unicode code points and UTF-8/UTF-16 byte encoding for non-English text and emoji.

🐞

Floating-point bug debugging

Understand why 0.1 + 0.2 ≠ 0.3 exactly by inspecting the IEEE 754 bit pattern behind each value.

🎨

Web & UI design

Convert hex color codes (#RRGGBB) to and from their decimal RGB components.

📡

Network engineering

Verify IP address ranges and subnet boundaries before deploying infrastructure changes.

🤖

Machine learning & data science

Understand floating-point precision limits when working with numeric model weights.

🧑‍🏫

Teaching aid

Generate instant conversions and bit visualizations for classroom demonstrations.

🧑‍💻

Interview preparation

Practice binary, hex, and bitwise-operation questions common in technical coding interviews.

🛡️

Security research

Inspect raw byte-level data and address structures when analyzing network traffic or malware samples.

Pros & Cons

Advantages and Limitations

What this binary & hex converter does well, and where it has boundaries

✅ Advantages

  • Free, instant, and requires no signup or account
  • Combines four developer tools in one place: base converter, IP tool, IEEE 754 visualizer, Unicode lookup
  • Converts decimal, binary, hex, and octal simultaneously as you type
  • Supports both signed and unsigned interpretation of bitwise results
  • Visualizes bits at 8, 16, 32, or 64-bit widths
  • Handles both IPv4 and IPv6 addresses, including subnet mask detection
  • Shows sign, exponent, and mantissa fields for both float32 and float64 precision
  • Unicode lookup covers ASCII, extended Latin, and full Unicode including emoji
  • Click-to-copy and export functionality for quick reuse of results
  • Runs entirely in your browser — no data ever leaves your device
  • Fast-loading and fully mobile-friendly
  • Free to use as many times as needed, with no calculation limit

⚠️ Limitations

  • Bitwise operations rely on JavaScript's 32-bit signed integer internals, which can affect edge-case operand values
  • Does not support IPv6 zone identifiers or some non-standard address notations
  • Floating-point display truncates the mantissa for very long binary fractions
  • Does not perform arbitrary-precision arithmetic — extremely large numbers may lose precision in decimal display
  • Unicode lookup processes one character at a time, not full strings
  • Subnet detection only recognizes simple all-1s-then-all-0s mask patterns
  • Does not visualize custom or non-IEEE-754 floating-point formats
Reference

Binary vs Octal vs Decimal vs Hexadecimal

The four number systems this converter translates between

BaseDigits UsedBits per DigitTypical Use
Binary (base 2)0–11How computers physically store all data
Octal (base 8)0–73Legacy Unix file permissions, some older systems
Decimal (base 10)0–9~3.32 (irrational)Everyday human-readable numbers
Hexadecimal (base 16)0–9, A–F4Memory addresses, color codes, compact binary shorthand

Common Mistakes and Expert Tips

❌ Common Mistakes

  • Forgetting the "0x" prefix convention when sharing hex values with others, causing ambiguity with decimal
  • Confusing signed and unsigned interpretation of the same bit pattern
  • Assuming IPv6 addresses can be parsed the same way as IPv4 (they use 8 hextets, not 4 octets)
  • Expecting exact decimal equality after floating-point arithmetic, without accounting for IEEE 754 rounding
  • Miscounting nibble groupings when converting binary to hex by hand, especially with numbers that aren't multiples of 4 bits
  • Treating an 8-bit result as if it were 32-bit (or vice versa) without checking which bit width applies

💡 Expert Tips & Best Practices

  • Always double-check whether a value should be interpreted as signed or unsigned before using it downstream
  • Use the bit-width selector to match the actual data type width you're working with in code
  • Pair this tool with the Matrix Calculator when working through linear algebra used in graphics or machine learning pipelines
  • Cross-check large numeric IDs or hashes with the Prime Number Checker when prime moduli are involved in hash table design
  • For factorization-related base-conversion questions, the Factor Calculator can help verify divisibility properties of a number before converting it
📝

Summary: This binary & hex converter gives you an instant, free way to convert between number bases, inspect Unicode characters, break down IP addresses, and visualize IEEE 754 floating-point representation — all in one developer-focused tool. Pair it with the Matrix Calculator and Prime Number Checker for a fuller toolkit of math and computer science calculators.

FAQ

Frequently Asked Questions

Common questions about binary, hex, and number base conversion

How do you convert decimal to binary?
Divide the decimal number by 2 repeatedly, recording the remainders. Read the remainders from bottom to top. Example: 42 ÷ 2 = 21 r0 → 21 ÷ 2 = 10 r1 → 10 ÷ 2 = 5 r0 → 5 ÷ 2 = 2 r1 → 2 ÷ 2 = 1 r0 → 1 ÷ 2 = 0 r1. Reading remainders upward: 101010 = 42 in decimal.
How do you convert binary to hexadecimal?
Group binary digits into sets of 4 from right to left (padding with zeros if needed), then convert each group to its hex digit: 0000=0, 0001=1, …, 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F. Example: 11001010 → 1100 1010 → C A = 0xCA = 202 decimal.
What are common hex colors in web design?
Hex colors use 6 hex digits: #RRGGBB. White = #FFFFFF (255,255,255), Black = #000000 (0,0,0), Red = #FF0000 (255,0,0), Green = #00FF00, Blue = #0000FF. Each pair represents intensity 0–255. Well-known UI colors developers encounter globally: #FF0000 (pure red), #1DA1F2 (Twitter/X blue), #25D366 (WhatsApp green), #0D9488 (NeftCal teal — R:13 G:148 B:136). The # prefix is CSS notation; the actual value is 3 bytes (24-bit color).
What is a bitwise AND / OR / XOR operation?
Bitwise operations work bit-by-bit: AND (A & B) — 1 only if both bits are 1. OR (A | B) — 1 if either bit is 1. XOR (A ^ B) — 1 if bits differ. NOT (~A) — flips all bits. Left shift (A << n) — multiplies by 2ⁿ. Right shift (A >> n) — divides by 2ⁿ. These operations are fundamental in low-level programming, cryptography, and networking (subnet masks). Toggle the Signed/Unsigned button above the results to see two's complement interpretation alongside raw bits.
What is two's complement and signed vs unsigned?
Two's complement is how computers represent negative integers. To negate a number: flip all bits, then add 1. Example: +5 in 8-bit = 00000101. Flip bits: 11111010. Add 1: 11111011 = -5. The most significant bit (leftmost) indicates sign: 0 = positive, 1 = negative. This is why NOT(5) shows as 4294967290 in unsigned 32-bit, but -6 in signed 32-bit. Use the Signed/Unsigned toggle in the bitwise results panel to switch between both interpretations.
What is IEEE 754 and why does 0.1 + 0.2 ≠ 0.3?
IEEE 754 is the international standard for floating-point arithmetic used in virtually all processors. A 32-bit float has: 1 sign bit, 8 exponent bits (biased by 127), 23 mantissa bits. A 64-bit double has: 1 sign bit, 11 exponent bits (biased by 1023), 52 mantissa bits. Most decimal fractions (0.1, 0.2, 1/3) cannot be represented exactly in binary, so they're stored as the nearest representable value. This is why 0.1 + 0.2 gives 0.30000000000000004 in every programming language — it's a binary representation artifact, not a bug.
How does the Unicode / ASCII lookup work?
Standard ASCII covers code points 0–127 (English letters, digits, symbols). Unicode extends this to over 1 million code points covering Devanagari (Hindi), Tamil, Telugu, Chinese/Japanese/Korean (CJK), Arabic, Hebrew, emoji, and more. The lookup shows: the Unicode code point in U+XXXX format, the UTF-8 encoding (1–4 bytes), and the UTF-16 encoding. For example, the Hindi letter 'अ' is U+0905, encoded as 3 UTF-8 bytes (0xE0 0xA4 0x85). Emoji like '😀' are U+1F600, encoded as 4 UTF-8 bytes.
How do you convert binary to octal?
Group binary digits into sets of 3 from right to left (padding with zeros if needed), then convert each group to its octal digit (0-7). For example, 11001010 padded to 011 001 010 becomes octal 312. This calculator does the grouping automatically in the Number Converter tab.
Why do IP addresses use binary and hexadecimal?
IPv4 addresses are really 32-bit binary numbers, split into four 8-bit octets for readability (each written as 0-255 in decimal). IPv6 addresses are 128-bit numbers split into eight 16-bit hextets, written in hexadecimal because hex packs 4 bits per digit, keeping the address shorter than a full binary or decimal string.
What is a subnet mask and how is it related to binary?
A subnet mask is a 32-bit pattern of consecutive 1s followed by consecutive 0s (e.g. 255.255.255.0 = 11111111.11111111.11111111.00000000) that separates the network portion of an IP address from the host portion. The count of leading 1 bits gives the CIDR prefix length, such as /24 for that example.
What is a nibble and why does it matter for hex conversion?
A nibble is a group of 4 binary bits, which corresponds to exactly one hexadecimal digit (0-F). Because a byte is 8 bits (two nibbles), any byte can be written as exactly two hex digits — this is why hex is the standard shorthand for binary data in programming and networking.
What does an 8-bit, 16-bit, 32-bit, or 64-bit number range mean?
The bit width determines how many binary digits represent a value, and therefore its range. Unsigned 8-bit covers 0-255, 16-bit covers 0-65,535, 32-bit covers 0-4,294,967,295, and 64-bit covers 0 to about 1.8×10^19. Signed versions of each width use half that range for positive numbers and half for negative, via two's complement.
How does left shift and right shift relate to multiplication and division?
A left shift (A << n) moves every bit n places left, which is equivalent to multiplying A by 2ⁿ. A right shift (A >> n) moves bits right, equivalent to dividing by 2ⁿ and discarding the remainder. These bitwise shift operations are much faster in hardware than general multiplication or division.
How many bytes does a UTF-8 encoded character use?
UTF-8 uses 1 byte for standard ASCII characters (code points 0-127), 2 bytes for code points up to 0x7FF (covering many Latin-script and Cyrillic extensions), 3 bytes for code points up to 0xFFFF (including most CJK and Indic scripts), and 4 bytes for code points above that (including most emoji).
What is the difference between IPv4 and IPv6 addressing?
IPv4 addresses are 32 bits, written as four decimal octets (e.g. 192.168.1.1), giving about 4.3 billion possible addresses. IPv6 addresses are 128 bits, written as eight hexadecimal hextets (e.g. 2001:db8::1), providing a vastly larger address space designed to outlast IPv4 exhaustion.
Learn More

Authoritative Resources on Number Systems

Trusted educational references to go deeper on binary, hex, and computer arithmetic

Related Calculators

Explore other tech and math tools