1. Converter Tools > 
  2. Conversions > 
  3. Number Base Converter

Number Base Converter

Convert between decimal, binary, hexadecimal, and octal. Enter a non-negative integer in the selected base and get the result in the other base. Pick a base on the left and one on the right.

Convert non-negative integers between decimal, binary, hexadecimal, and octal. Select the From base in the left table and the To base in the right table, enter the value in the selected base, and copy the result. The input must be a valid number in the chosen base (e.g. only 0 and 1 for binary, 0–9 and A–F for hex).

Loading…

Advertisement

Examples

  • 255 (decimal) → FF (hex)
  • 255 (decimal) → 11111111 (binary)
  • FF (hex) → 255 (decimal)

FAQ

What is hexadecimal?

Hexadecimal (base 16) uses digits 0–9 and A–F. It is often used in computing (e.g. for colors or memory addresses).

What is octal?

Octal (base 8) uses digits 0–7. It is less common today but still used in some computing contexts.

Can I convert negative numbers?

This tool accepts only non-negative integers. For negative or fractional values you would need a different approach.

Why do computers use binary?

Binary (base 2) maps directly to the two physical states of electronic circuits: off (0) and on (1). All data a computer processes — numbers, text, images — is ultimately stored and manipulated as sequences of 0s and 1s.

Where is hexadecimal used in web development?

Hex is used for CSS colors (#ff5733), HTML character references, HTTP encoding, and crypto hashes. A six-digit hex color is three pairs: RR GG BB in base 16.

How do I add two binary numbers?

Add column by column from right to left, carrying when the sum exceeds 1. Example: 0101 + 0011 = 1000 (5 + 3 = 8). Convert both to decimal first if you only need the result.

What is the largest value that fits in one byte?

A byte is 8 binary digits, so the maximum unsigned value is 11111111 in binary = FF in hex = 255 in decimal.

Why do programmers count from 0?

Arrays in most languages are zero-indexed because memory addresses start at offset 0. Binary naturally represents 0 to (2ⁿ − 1) for n-bit values, making zero-based counting efficient.

What is the difference between hex and base-64?

Hex uses 16 symbols (0–9 A–F), encoding each byte as two characters. Base-64 uses 64 symbols (A–Z a–z 0–9 +/), encoding every 3 bytes as 4 characters — more compact but not the same as a number base.

How do I read a hex color code like #3a9fbf?

Split it into three byte pairs: 3A (red) = 58 decimal, 9F (green) = 159 decimal, BF (blue) = 191 decimal. That gives rgb(58, 159, 191), a medium cyan-blue.

What are signed vs unsigned integers?

Unsigned integers use all bits for magnitude (0 to 2ⁿ−1). Signed integers reserve the top bit for sign, giving a range of −2ⁿ⁻¹ to 2ⁿ⁻¹−1. For example, an unsigned 8-bit integer goes 0–255, while signed 8-bit goes −128–127.

How are IP addresses related to hex?

IPv4 addresses like 192.168.1.1 can be written as hex: C0.A8.01.01. IPv6 addresses are always written in hex groups (e.g. 2001:0db8:85a3::1). Converting to decimal or hex is a common networking task.

What does 0x mean before a number?

The 0x prefix is a convention in C, Python, JavaScript, and many languages to denote a hexadecimal literal. For example, 0xFF equals 255 in decimal.

Advertisement
Ad
Converter Tools

  • Home


    • Conversions
      • Length Converter
      • Area Converter
      • Volume Converter
      • Color Converter
      • Weight Converter
      • Temperature Converter
      • Angle Converter
      • Time Converter
      • Data Size Converter
      • Energy Converter
      • Number Base Converter
    • Calculators
      • Lengths
        • Feet and Inches Calculator
        • Pythagorean Theorem Calculator
        • Circle Circumference Calculator
        • Circle Area Calculator
        • Triangle Area Calculator
        • Rectangle Area and Perimeter Calculator
      • Percentages
        • What is X% of Y Calculator
        • X is What Percent of Y Calculator
        • Percentage Change Calculator
        • Add or Subtract Percentage Calculator
      • Time
        • Age Calculator
        • Date Difference Calculator
        • Day of Week Calculator
        • Countdown Calculator
        • Week Number Calculator
      • Body indices
        • BMR Calculator
        • TDEE Calculator
        • Ideal Weight Calculator
        • Body Fat Percentage Calculator
        • Waist-to-Hip Ratio Calculator
        • Calorie Deficit Calculator
        • BMI Calculator
      • Finance
        • Tip Calculator
        • Discount Calculator
        • Simple Interest Calculator
        • Compound Interest Calculator
        • Loan Payment (EMI) Calculator
      • Math
        • Quadratic Equation Solver
        • Factorial Calculator
        • GCD and LCM Calculator
        • Prime Number Checker
    • Dev Tools
      • Base64 Encode and Decode
      • Password Generator
      • QR Code Generator
      • Regex Tester
      • UUID Generator
    • Images
      • Image Conversions
      • Image Compression
      • Image Resize
      • Image Grayscale
      • EXIF Reader
      • Image Filters
      • Edge Detection
      • Image Crop
      • Image Rotate & Flip
      • Image Format Info
      • Image Thumbnail
    • File conversions
      • CSV and Excel Converter
    • PDF editing
      • Merge PDFs
      • Split PDF
      • Extract PDF pages
      • Rotate PDF pages
      • Add watermark to PDF
      • PDF metadata
    • Cheatsheets
      • CSS
        • CSS Color Cheatsheet
        • CSS Common Properties Cheatsheet
        • CSS Flexbox Cheatsheet
        • CSS Grid Cheatsheet
      • HTML
        • HTML Cheatsheet
      • Markdown
        • Markdown Cheatsheet
      • Git
        • Git Cheatsheet
      • Regex
        • Regex Cheatsheet
      • Time
        • Unix Timestamp Cheat
    • About
    • Contact
    • Privacy Policy
    • Terms of Use

        Built with by Hugo

        We use cookies and similar technologies for ads (e.g. Google AdSense) and analytics. By continuing you consent to our Privacy Policy. You can change preferences anytime.