InTab

Number Base Converter

Convert numbers between binary, octal, decimal and hexadecimal.

Converters: Turn one format into another. It runs in your browser, so nothing you enter is uploaded.

What it does

The Number Base Converter converts whole numbers between binary, octal, decimal and hexadecimal. Type in any field and the others update straight away. It handles numbers of any size, negative numbers, and shows how many bits the value needs.

How to use it

  1. Type a number into the field for its base: Binary (2), Octal (8), Decimal (10) or Hexadecimal (16).
  2. Read the same value in the other bases and copy the one you need.

Underscores and spaces are ignored, so 1111_0000 and ff ff work. Use a leading - for negative numbers.

Examples

Decimal Binary Octal Hex
255 11111111 377 ff
2026 11111101010 3752 7ea

255 needs 8 bits, which is why it is the largest value in one byte.

Good to know

  • Hexadecimal uses digits 0–9 and letters a–f, where a is 10 and f is 15. Each hex digit is exactly 4 bits.
  • Values are exact for any size (BigInt), so 64-bit IDs and large hashes convert without rounding.
  • Negative numbers are shown with a minus sign, not as two's complement.

FAQ

How do I convert a colour like #4f46e5? Use the Color Converter, which turns hex colours into RGB, HSL and more.

Can it convert fractions? No, whole numbers only.

More Converters tools

  • JSON to Code: Generate TypeScript, C#, Java, Python, Go, Kotlin, Swift, Rust, PHP, Dart types from JSON.
  • XML to Code: Generate C# (XmlSerializer), Java (JAXB), Go and TypeScript classes that read your XML.
  • Data Format Converter: Convert between JSON, YAML, XML, CSV and TOML in any direction.
  • JSON to YAML Converter: Turn JSON into clean YAML (and back) for configs, Kubernetes and CI files.
  • XML to JSON Converter: Convert XML documents to JSON, keeping attributes, and back again.
  • Color Converter: Convert colors between HEX, RGB, HSL, HSV and CMYK.
  • Case Converter: camelCase, snake_case, kebab-case, PascalCase and more.