inyourbrowser.com

Number base converter

Number base converter is a developer tool that converts integers between binary, octal, decimal, and hexadecimal. It accepts 0b, 0o and 0x prefixes, keeps values beyond 2^53 exact with BigInt, and shows all four bases at once. The tool runs in your browser.

BIN–
OCT–
DEC–
HEX–

INPUT BASE

All bases shown simultaneously.

Runs entirely in your browser

How to convert between number bases

  1. Pick the input base in the side panel: Hex → Dec, Dec → Hex, Bin → Dec, Dec → Bin or Octal. Switching clears the input field.
  2. Type the number. Hex, binary and octal values may start with 0x, 0b or 0o, and a leading minus sign is kept.
  3. Read the BIN, OCT, DEC and HEX rows, which update as you type. Hex output is uppercase.
  4. If an amber Not a valid … value message appears, remove any digit the base does not allow, or any decimal point.
  5. Press Copy on a row to copy that value to the clipboard.

Common uses

  • Converting hexadecimal colour codes or memory addresses to decimal, use color converter when you need to translate HEX to RGB or HSL for CSS
  • Working with binary, octal, and hex values in low-level programming or networking. The CIDR calculator is useful for subnet mask and address calculations
  • Converting between number bases for computer science coursework or exercises

Technical specification

  • Algorithm or formula: Standard radix conversion using positional notation. Conversion goes through a BigInt intermediate so values beyond 2^53 stay precise.
  • Browser API or library: Native JavaScript BigInt: the input is read digit by digit and written out with BigInt.prototype.toString. No external library.
  • Input limits: Arbitrary precision (BigInt). Negative values are shown with a minus sign (sign and magnitude); there is no two's-complement or fixed bit-width view.
  • Output: Plain text representations in binary, octal, decimal, and hexadecimal, copyable per-field.
  • Known limitations: Integers only; fractional input such as 1.5 is rejected with a validation message. Only bases 2, 8, 10 and 16 are available.

Frequently asked questions

What bases does the tool support?
The tool converts between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16), the four most commonly used bases in computing.
Is my data sent to a server?
All conversions are pure JavaScript calculations in your browser. Our servers are not involved at any point.
Can I convert negative numbers?
Yes. Type a minus sign before the value and every output shows the same magnitude with a minus sign, for example -255 is -FF in hex and -11111111 in binary. The tool does not produce two's complement bit patterns.
Is there a size limit for the numbers?
The tool uses JavaScript's BigInt for large number support, so you can convert numbers beyond the standard 64-bit integer limit.

Related tools

Byte converter
Convert between bytes, KB, MB, GB and TB in both decimal (SI) and binary (IEC) units.
Chmod calculator
Click permission bits to get the numeric (755) and symbolic (rwxr-xr-x) notation instantly.
CIDR / subnet calculator
Calculate network address, broadcast, host range and usable hosts from any CIDR block.
Color converter
Convert HEX, RGB, and HSL color values instantly. Live preview swatch included.
Roman numeral converter
Convert between Roman numerals and Arabic numbers. Supports 1 to 3,999.

Reviewed and tested September 30, 2026.