Initializing, please wait a moment

Type the value, choose the base it is currently in and the base you want, and the result updates live; use Swap to reverse the direction.

Values with a leading 0x, 0b, or 0o prefix are recognized automatically for the matching base, so pasted values just work. If a character does not belong in the chosen base, the tool names exactly which character and position is wrong instead of failing silently. Copy the result to your clipboard with one click.

Number Base Converter (Binary/Hex/Octal/Decimal)


Convert a number between binary, octal, decimal, and hexadecimal (or any custom base 2-36), right in the browser.


Key features

  • Converts a typed value between binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), or a custom base 2 to 36, live on every keystroke.
  • From-base and To-base each offer the four common presets plus a "Custom base..." option from 2 to 36.
  • Accepts and strips common prefixes - 0x for hex, 0b for binary, 0o for octal - so pasted values just work.
  • The Swap button exchanges the From and To bases and reuses the last result as the new input, so you can convert the other direction in one click.
  • The Copy-result button copies the current output to the clipboard.
  • An invalid digit for the chosen base produces a plain-language error that names the offending character and its position, shown inline in the output area rather than only in the console.
  • On page load a worked example (ff in hex becomes 255 in decimal) is already shown, so you see a result with zero interaction.

Common bases at a glance

BaseName
2Binary
8Octal
10Decimal
16Hexadecimal

Custom bases from 2 to 36 are supported for less common conversions beyond these four presets.


How it stays accurate

Conversion uses exact digit-by-digit BigInt arithmetic, not the native Number type, so values beyond 2^53 - 1 stay accurate instead of silently losing precision. Negative numbers are handled only with JavaScript's own signed-integer semantics for a leading minus sign, not two's-complement representation for an arbitrary bit width.


Privacy

Everything runs in this browser tab; the value you type is never uploaded to a server or stored beyond the page session, and no account or signup is required.

← Back to Developer Tools

Related tools:

  • MD5 converter - Text to MD5 + MD5 to text cached lookup.
  • Convert PDF to TEXT online - Extract text from PDF online for copying and editing.
  • Text To HTML Editor - Text to HTML editor online - write in a WYSIWYG view and watch the generated HTML update live, with
  • CSS Gradient Animator Generator - CSS gradient generator - build animated linear gradients with live preview; copy ready-to-paste CSS
  • CSS Minifier - Minify CSS online for faster page loads.
  • CSS UnMinifier - CSS unminifier online - beautify minified CSS with proper indentation, line breaks, and readable
  • JavaScript Minifier - JavaScript minifier online free - paste your JS, click Minify, and copy the compressed code.
  • JSON Parser By Tree View - Paste JSON to validate, format, and view it in a tree.
  • JavaScript UnMinifier - JavaScript unminifier online - reformat minified JS with indentation and line breaks for
  • Keyboard Test - Press each key - the on-screen layout highlights it.
  • Text Diff - Compare code, text, or HTML online, side by side.
  • Developer Tools - Developer tools to parse JSON, minify or unminify CSS/JS, compare text, and generate MD5 hashes.

Tags: #developer

Related guides:

Loading reviews...

Frequently Asked Questions

What does Number Base Converter (Binary/Hex/Octal/Decimal) do?

Convert a number between binary, octal, decimal, and hexadecimal (or any custom base 2-36), right in the browser.

When should I reach for number base converter (binary/hex/octal/decimal)?

Custom bases from 2 to 36 are supported for less common conversions beyond the four common presets.

Does it handle negative numbers?

Only in JavaScript's signed-integer sense (a leading minus sign) - it does not represent negative numbers in two's-complement form for an arbitrary bit width.