---
title: "Number Base Converter — Binary, Octal, Decimal, Hex"
description: "Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Step-by-step conversion shown. Used in computer science, programming, and electronics worldwide."
url: "https://worldcalculators.org/calculators/number-base/"
canonical: "https://worldcalculators.org/calculators/number-base/"
---

# Binary / Hex Converter

Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Step-by-step conversion shown. Used in computer science, programming, and electronics worldwide.

## Quick answer

42 in all bases: Binary = 101010 · Octal = 52 · Decimal = 42 · Hex = 2A . Each hex digit = 4 bits. FF hex = 11111111 binary = 255 decimal. Hex is used for web colors: #FF0000 = pure red.

## Hex Colours in Web Design

Hexadecimal is the universal standard for web colours. Each colour is represented as #RRGGBB — two hex digits each for red, green, and blue channels (0–255). Examples:
This standard is used identically by developers in the US, Europe, Japan, India, and everywhere else — hexadecimal is truly a global computing language.

## Frequently Asked Questions

RGB colors have three channels (red, green, blue), each with 256 possible values (0–255). Each channel is exactly one byte — representable as 2 hex digits (00 to FF). So #FF5733 means red=255, green=87, blue=51. This is more compact than decimal (rgb(255,87,51)) and more readable than 24-bit binary. The CSS hex color standard was introduced in HTML 2.0 (1995) and is now universal across all countries and browsers.
8-bit unsigned: 0–255 (2^8 - 1). 8-bit signed: -128 to 127. 16-bit unsigned: 0–65,535. 16-bit signed: -32,768 to 32,767. 32-bit unsigned: 0–4,294,967,295. 64-bit unsigned: 0–18,446,744,073,709,551,615. These limits appear across all computing — from C data types to network packet fields to image colour depths.

Source: https://worldcalculators.org/calculators/number-base/
Markdown mirror of the HTML page. Prefer this URL for RAG; the interactive calculator still lives on the HTML page.
