Number Base Converter

decimal Input

binary Output

Batch Input

0 Items

0 Output lines

0 Characters

What this converter does

This Number Base Converter converts signed integers between the four most common number systems:

  • Decimal (base 10)
  • Binary (base 2)
  • Octal (base 8)
  • Hexadecimal (base 16)

It’s built for math-style integers (including very large values), not for text encoding or byte decoding.


How to use it

  1. Pick your Input base (Decimal / Binary / Octal / Hex).
  2. Type or paste a number in the left box.
  3. Pick your Output base.
  4. Copy the converted result from the right box.

Helpful switches

  • Batch by newline — convert one value per line
  • Trim lines — removes extra whitespace on each line (best for pasted lists)
  • Uppercase hex — outputs A–F instead of a–f

Nice detail: in batch mode, each line is processed independently, so one invalid line won’t stop the rest.


Input rules (so you don’t get surprises)

Signed values

You can use:

  • - for negative numbers (e.g. -42, -101010)
  • + for explicit positive numbers (e.g. +42)

Optional prefixes

Prefixes are accepted when they match your selected input base:

  • Binary: 0b1010
  • Octal: 0o755
  • Hex: 0xFF

Separators are ignored

Spaces and underscores are ignored, so all of these work:

  • 1111_0000
  • 0xFF FF
  • 1 000 000

Examples

Decimal → Binary

-42 → -101010

Hex → Decimal

0xFF → 255

Binary → Hex

10101101 → AD

Octal → Decimal

0755 (or 0o755) → 493

Batch mode: convert lists quickly

Enable Batch by newline and paste one value per line:

Input (Binary):

1010
11110000
-1001
2

Output (Decimal):

10
240
-9
!ERROR: Binary input may contain only 0 and 1

That last row fails, but the others still convert.

Common use cases

  • Converting IDs between hex and decimal
  • Working with bitmasks (binary ↔ hex)
  • Debugging or reading octal file permissions (octal ↔ decimal)
  • Learning how number bases work
  • Converting large integers safely (no floating-point rounding)

Troubleshooting

“Invalid digit for base…”

This means the input contains characters that don’t exist in the selected base:

  • Binary allows only 0 and 1
  • Octal allows 0–7
  • Decimal allows 0–9
  • Hex allows 0–9 and A–F

Fix it by either changing the input base, or removing the invalid digits.

“It converts some lines but not others”

That’s expected in batch mode: each line is handled separately so your valid rows still convert.

“My hex output is lowercase / uppercase”

Use the Uppercase hex toggle to control a–f vs A–F.

Tips

  • If you frequently paste hex values, keep Uppercase hex on for a more “engineering-style” output.
  • For binary readability, you can paste grouped bits like 1010_1100_1111 — separators are ignored.
  • For consistent results in batch mode, enable Trim lines when pasting from spreadsheets or documents.

Frequently Asked Questions

Decimal (base 10), Binary (base 2), Octal (base 8), and Hexadecimal (base 16).

Yes. You can use a leading minus sign (−) or plus sign (+) in any supported base.

Yes. Enable Batch by newline to convert one value per line. Each line is processed independently.

Yes. The converter accepts 0b / 0o / 0x prefixes when they match the selected input base.

Yes. Spaces and underscores are ignored so you can paste formatted values like 1111_0000 or 0xFF FF.

No. All conversions run locally in your browser.

Looking for a faster, single-purpose workflow?

Try a direct conversion below

Explore Our Tools

Read More From Our Blog