Skip to content
Toolbench

Number Base Converter

Convert between binary, octal, decimal, hexadecimal and any base up to 36 — exactly, at any size.

Runs entirely in your browser

Loading tool...

How to use

  1. Choose the base your value is written in, or paste it with a 0x, 0b or 0o prefix and it is detected.
  2. Type the value. Spaces, underscores and commas are ignored, so a grouped number pastes straight back in.
  3. Read the result in every common base at once.
  4. For a negative number, pick a width to see its two’s complement form.

Features

  • Exact at any size: a 64-bit value keeps every digit, where a converter built on floating point loses the last few.
  • Every base from 2 to 36, not just the common four.
  • Two’s complement at 8, 16, 32 and 64 bits, and a refusal rather than a wrap when a value does not fit.
  • Rejects digits that do not exist in the base instead of quietly ignoring them.
  • Runs entirely in your browser.

Frequently asked questions

Why do other converters get large hex values wrong?
Because they convert through a JavaScript number, which is a double and can only represent every integer up to 2⁵³. A 16-digit hexadecimal value — a 64-bit id, a hash fragment — is larger than that, so the last few digits come back changed. This tool uses arbitrary-precision integers throughout, so 0xFFFFFFFFFFFFFFFF is 18446744073709551615 and not something near it.
What is two’s complement, and why does -1 show as ff?
It is how computers actually store negative numbers: the value is added to 2 raised to the width, so at 8 bits, -1 becomes 256 - 1 = 255, which is ff. That is why a negative number read out of memory looks like a large positive one. Pick the width your data uses — 8, 16, 32 or 64 bits — and the representation matches what you would see in a debugger.
Why is 102 rejected as binary?
Because 2 is not a binary digit. A converter that skipped it would return a confidently wrong number, which is worse than an error. The same applies to 8 in octal and g in hexadecimal.
Can I paste a number with spaces in it?
Yes. Spaces, underscores and commas are ignored, so the grouped output of this tool — or a value copied from a spec — pastes straight back in without editing.

Convert length, weight, temperature, data, area, volume, speed and time.

Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes, or verify a checksum.

Convert a Unix timestamp to a date, or a date to a timestamp — in UTC and your own zone.